aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@gcc.gnu.org>2000-10-04 17:57:03 +0000
committerWilliam Cohen <wcohen@gcc.gnu.org>2000-10-04 17:57:03 +0000
commitf7b9c39dc89744b6362eb2db35c082f68a1429bd (patch)
tree924771ef74c4339948819ed996f08d1c06c23e4e
parentbe9196f86e7cbbc49c9049513716fe75d0994285 (diff)
downloadgcc-f7b9c39dc89744b6362eb2db35c082f68a1429bd.zip
gcc-f7b9c39dc89744b6362eb2db35c082f68a1429bd.tar.gz
gcc-f7b9c39dc89744b6362eb2db35c082f68a1429bd.tar.bz2
A test to verify the patch to warn of initializers for zero-length
arrays is installed in the compiler. From-SVN: r36711
-rw-r--r--gcc/testsuite/gcc.dg/20000926-1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20000926-1.c b/gcc/testsuite/gcc.dg/20000926-1.c
new file mode 100644
index 0000000..630cbcb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20000926-1.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ by William Cohen <wcohen@redhat.com> */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct PDATA
+{
+ unsigned int Dummy:32;
+ const char* PName;
+};
+
+typedef struct PDATA P_DATA;
+
+struct PLAYBOOK {
+ const char * BookName;
+ P_DATA Play[0];
+};
+
+struct PLAYBOOK playbook =
+{
+ "BookName",
+ {
+ { 1, "PName0" }, /* { dg-warning "excess elements in array initializer|(near initialization for `playbook.Play')" } */
+ }
+};