Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: demonstrate wrong emit...



details:   https://anonhg.NetBSD.org/src/rev/9c7f6be21766
branches:  trunk
changeset: 375920:9c7f6be21766
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon May 22 11:51:46 2023 +0000

description:
tests/lint: demonstrate wrong emitted array length in initialization

Seen in usr.bin/indent/debug.c, in the various 'name' arrays.

diffstat:

 tests/usr.bin/xlint/lint1/emit.c      |  11 ++++++++++-
 tests/usr.bin/xlint/lint1/emit.exp-ln |   1 +
 2 files changed, 11 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r 9c6b063e59aa -r 9c7f6be21766 tests/usr.bin/xlint/lint1/emit.c
--- a/tests/usr.bin/xlint/lint1/emit.c  Mon May 22 10:28:59 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/emit.c  Mon May 22 11:51:46 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: emit.c,v 1.15 2023/03/28 14:44:34 rillig Exp $ */
+/*     $NetBSD: emit.c,v 1.16 2023/05/22 11:51:46 rillig Exp $ */
 # 3 "emit.c"
 
 /*
@@ -307,3 +307,12 @@ struct compound_expression_in_initialize
                [0] = "zero",
        },
 };
+
+/*
+ * FIXME: The type that ends up in the .ln file is 'A0cC', which is wrong as it
+ * has array size 0 instead of the correct 8.
+ *
+ * This is caused by cgram_declare being called before processing the
+ * initializer.
+ */
+const char array_of_unknown_size[] = "unknown";
diff -r 9c6b063e59aa -r 9c7f6be21766 tests/usr.bin/xlint/lint1/emit.exp-ln
--- a/tests/usr.bin/xlint/lint1/emit.exp-ln     Mon May 22 10:28:59 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/emit.exp-ln     Mon May 22 11:51:46 2023 +0000
@@ -82,3 +82,4 @@ 288u0.288x17declared_used_var
 289u0.289x16defined_used_var
 286d0.286d8use_varsF0V
 305d0.305d8compoundsT134compound_expression_in_initializer
+318d0.318d21array_of_unknown_sizeA0cC



Home | Main Index | Thread Index | Old Index