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: improve test for initi...



details:   https://anonhg.NetBSD.org/src/rev/b97c64ea3dc6
branches:  trunk
changeset: 1029126:b97c64ea3dc6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 22 14:32:31 2021 +0000

description:
tests/lint: improve test for initialization of array of unknown size

Previously, the test didn't show that the size of the resulting object
was updated too early.

diffstat:

 tests/usr.bin/xlint/lint1/d_c99_init.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (25 lines):

diff -r 2521dfec45b3 -r b97c64ea3dc6 tests/usr.bin/xlint/lint1/d_c99_init.c
--- a/tests/usr.bin/xlint/lint1/d_c99_init.c    Wed Dec 22 14:25:35 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.c    Wed Dec 22 14:32:31 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_init.c,v 1.36 2021/12/22 00:45:53 rillig Exp $   */
+/*     $NetBSD: d_c99_init.c,v 1.37 2021/12/22 14:32:31 rillig Exp $   */
 # 3 "d_c99_init.c"
 
 /*
@@ -182,11 +182,11 @@
                 * yet since its type is still incomplete.  Lint could warn
                 * about this, but GCC and Clang already do.
                 *
-                * This test case demonstrates that in
-                * extend_if_array_of_unknown_size, setcomplete is called too
-                * early.
+                * Before init.c 1.179 from 2021.03.30, the type information
+                * of 'points' was set too early, resulting in a negative
+                * array size below.
                 */
-               sizeof(points),
+               sizeof(int[-(int)sizeof(points)]),
                4
        }
 };



Home | Main Index | Thread Index | Old Index