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/e655beb62e44
branches:  trunk
changeset: 979506:e655beb62e44
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 bde1a97b73cd -r e655beb62e44 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 bde1a97b73cd -r e655beb62e44 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