Module Name: src
Committed By: christos
Date: Thu Aug 18 14:45:56 UTC 2016
Modified Files:
src/tests/usr.bin/xlint/lint1: Makefile
Added Files:
src/tests/usr.bin/xlint/lint1: d_c99_anon_union.c
Log Message:
new test for struct that only has anon members, and that the size of struct
is computer right.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_c99_anon_union.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/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.11 src/tests/usr.bin/xlint/lint1/Makefile:1.12
--- src/tests/usr.bin/xlint/lint1/Makefile:1.11 Wed Oct 14 12:32:55 2015
+++ src/tests/usr.bin/xlint/lint1/Makefile Thu Aug 18 10:45:56 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2015/10/14 16:32:55 christos Exp $
+# $NetBSD: Makefile,v 1.12 2016/08/18 14:45:56 christos Exp $
NOMAN= # defined
@@ -11,6 +11,7 @@ TESTS_SH= t_integration
FILESDIR= ${TESTSDIR}
FILES+= d_alignof.c
FILES+= d_c99_anon_struct.c
+FILES+= d_c99_anon_union.c
FILES+= d_c99_complex_num.c
FILES+= d_c99_complex_split.c
FILES+= d_c99_compound_literal_comma.c
Added files:
Index: src/tests/usr.bin/xlint/lint1/d_c99_anon_union.c
diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_c99_anon_union.c:1.1
--- /dev/null Thu Aug 18 10:45:56 2016
+++ src/tests/usr.bin/xlint/lint1/d_c99_anon_union.c Thu Aug 18 10:45:56 2016
@@ -0,0 +1,16 @@
+/* struct with only anonymous members */
+
+struct foo {
+ union {
+ long loo;
+ double doo;
+ };
+};
+
+int
+main(void) {
+
+ struct foo *f = 0;
+ printf("%p\n", &f[1]);
+ return 0;
+}