Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: fix internal error for sizeof(typeof)
details: https://anonhg.NetBSD.org/src/rev/3b1468cf186d
branches: trunk
changeset: 984671:3b1468cf186d
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Jul 15 21:56:51 2021 +0000
description:
lint: fix internal error for sizeof(typeof)
diffstat:
tests/usr.bin/xlint/lint1/decl.c | 36 +++++++++++++++++++++++++++++++-----
usr.bin/xlint/lint1/decl.c | 6 ++++--
2 files changed, 35 insertions(+), 7 deletions(-)
diffs (74 lines):
diff -r e8dd14d6f7e1 -r 3b1468cf186d tests/usr.bin/xlint/lint1/decl.c
--- a/tests/usr.bin/xlint/lint1/decl.c Thu Jul 15 21:34:11 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl.c Thu Jul 15 21:56:51 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.7 2021/07/15 21:34:11 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.8 2021/07/15 21:56:51 rillig Exp $ */
# 3 "decl.c"
/*
@@ -131,7 +131,33 @@
unsigned long cover_abstract_declaration_declmods = sizeof(const);
unsigned long cover_abstract_declaration_declmods_abstract_declarator =
sizeof(const *);
-// FIXME:
-// lint: internal error in decl.c:833 near decl.c:135: end_type(unsigned long)
-//unsigned long cover_abstract_declarator_typeof =
-// sizeof(const typeof(cover_abstract_declaration_declmods));
+
+unsigned long cover_abstract_declarator_typeof =
+ sizeof(const typeof(cover_abstract_declaration_declmods));
+
+_Bool bool;
+char plain_char;
+signed char signed_char;
+unsigned char unsigned_char;
+short signed_short;
+unsigned short unsigned_short;
+int signed_int;
+unsigned int unsigned_int;
+long signed_long;
+unsigned long unsigned_long;
+
+/*
+ * Before decl.c 1.201 from 2021-07-15, lint crashed with an internal error
+ * in end_type.
+ */
+unsigned long sizes =
+ sizeof(const typeof(bool)) +
+ sizeof(const typeof(plain_char)) +
+ sizeof(const typeof(signed_char)) +
+ sizeof(const typeof(unsigned_char)) +
+ sizeof(const typeof(signed_short)) +
+ sizeof(const typeof(unsigned_short)) +
+ sizeof(const typeof(signed_int)) +
+ sizeof(const typeof(unsigned_int)) +
+ sizeof(const typeof(signed_long)) +
+ sizeof(const typeof(unsigned_long));
diff -r e8dd14d6f7e1 -r 3b1468cf186d usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Thu Jul 15 21:34:11 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c Thu Jul 15 21:56:51 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.200 2021/07/15 07:58:05 rin Exp $ */
+/* $NetBSD: decl.c,v 1.201 2021/07/15 21:56:51 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.200 2021/07/15 07:58:05 rin Exp $");
+__RCSID("$NetBSD: decl.c,v 1.201 2021/07/15 21:56:51 rillig Exp $");
#endif
#include <sys/param.h>
@@ -830,6 +830,8 @@
case LCOMPLEX:
break;
default:
+ if (is_integer(t))
+ break;
INTERNAL_ERROR("end_type(%s)", tspec_name(t));
}
if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) {
Home |
Main Index |
Thread Index |
Old Index