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 lint: document purpose of the test...



details:   https://anonhg.NetBSD.org/src/rev/c75a67eaa7a0
branches:  trunk
changeset: 1017541:c75a67eaa7a0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 30 13:41:27 2020 +0000

description:
lint: document purpose of the test d_struct_init_nested

diffstat:

 tests/usr.bin/xlint/lint1/d_struct_init_nested.c   |  7 +++++++
 tests/usr.bin/xlint/lint1/d_struct_init_nested.exp |  8 ++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r a6c6d1a49336 -r c75a67eaa7a0 tests/usr.bin/xlint/lint1/d_struct_init_nested.c
--- a/tests/usr.bin/xlint/lint1/d_struct_init_nested.c  Wed Dec 30 13:17:42 2020 +0000
+++ b/tests/usr.bin/xlint/lint1/d_struct_init_nested.c  Wed Dec 30 13:41:27 2020 +0000
@@ -1,5 +1,12 @@
 # 2 "d_struct_init_nested.c"
 
+/*
+ * Initialization of a nested struct, in which some parts are initialized
+ * from non-constant expressions of the inner struct type.
+ *
+ * In C99, 6.7.8p13 describes exactly this case.
+ */
+
 typedef enum O1 { O1C = 101 } O1;
 typedef enum O2 { O2C = 102 } O2;
 typedef enum O3 { O3C = 103 } O3;
diff -r a6c6d1a49336 -r c75a67eaa7a0 tests/usr.bin/xlint/lint1/d_struct_init_nested.exp
--- a/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp        Wed Dec 30 13:17:42 2020 +0000
+++ b/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp        Wed Dec 30 13:41:27 2020 +0000
@@ -1,4 +1,4 @@
-d_struct_init_nested.c(27): initialisation type mismatch (enum I1) and (struct Inner1) [185]
-d_struct_init_nested.c(29): too many struct/union initializers [172]
-d_struct_init_nested.c(54): initialisation type mismatch (enum I1) and (struct Inner2) [185]
-d_struct_init_nested.c(56): warning: enum type mismatch in initialisation [210]
+d_struct_init_nested.c(34): initialisation type mismatch (enum I1) and (struct Inner1) [185]
+d_struct_init_nested.c(36): too many struct/union initializers [172]
+d_struct_init_nested.c(61): initialisation type mismatch (enum I1) and (struct Inner2) [185]
+d_struct_init_nested.c(63): warning: enum type mismatch in initialisation [210]



Home | Main Index | Thread Index | Old Index