+2004-10-26 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-parse.in (datadef): Use pedwarn rather than error and warning
+ for diagnostic in case of no declaration specifiers.
+
2004-10-26 Richard Sandiford <rsandifo@redhat.com>
PR bootstrap/15747
datadef:
setspecs notype_initdecls ';'
- { if (pedantic)
- error ("ISO C forbids data definition with no type or storage class");
- else
- warning ("data definition has no type or storage class");
-
+ { pedwarn ("data definition has no type or storage class");
POP_DECLSPEC_STACK; }
| declspecs_nots setspecs notype_initdecls ';'
{ POP_DECLSPEC_STACK; }
+2004-10-26 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * gcc.dg/decl-nospec-1.c, gcc.dg/decl-nospec-2.c,
+ gcc.dg/decl-nospec-3.c: New tests.
+
2004-10-26 Ziemowit Laski <zlaski@apple.com>
* objc.dg/super-class-3.m: New test.
--- /dev/null
+/* Data definition with no type or storage class should receive a
+ pedwarn, rather than a warning which becomes an error with
+ -pedantic. Test with no options. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+foo(); /* { dg-warning "warning: data definition has no type or storage class" } */
--- /dev/null
+/* Data definition with no type or storage class should receive a
+ pedwarn, rather than a warning which becomes an error with
+ -pedantic. Test with -pedantic. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+foo(); /* { dg-warning "warning: data definition has no type or storage class" } */
--- /dev/null
+/* Data definition with no type or storage class should receive a
+ pedwarn, rather than a warning which becomes an error with
+ -pedantic. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+foo(); /* { dg-error "error: data definition has no type or storage class" } */