Module Name:    src
Committed By:   rillig
Date:           Wed Dec 22 14:32:31 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: d_c99_init.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/tests/usr.bin/xlint/lint1/d_c99_init.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/d_c99_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.36 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.37
--- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.36	Wed Dec 22 00:45:53 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c	Wed Dec 22 14:32:31 2021
@@ -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 @@ struct point points[] = {
 		 * 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
 	}
 };

Reply via email to