This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR C/12466 -Wold-style-definition incorrectly warns withellipsises
- From: Kelley Cook <kcook34 at ford dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Sep 2003 13:50:39 -0400
- Subject: [PATCH] PR C/12466 -Wold-style-definition incorrectly warns withellipsises
- Hop-count: 1
- Reply-to: Kelley Cook <kelleycook at wideopenwest dot com>
http://gcc.gnu.org/PR12466 for details.
Essentially void foo(const char * format, ...) {}
warns using -Wold-style-definition.
OK to install?
Kelley Cook
2003-09-30 Kelley Cook <kelleycook@wideopenwest.com>
gcc:
PR C/12466
* c-parse.in (parmlist_2): Mark declaration with an ellipsis as ISO C.
gcc/testsuite:
* gcc.dg/Wold-style-definition-1.c: Add in 3 ellipsis testcases.
--- c-parse.in.orig 2003-09-30 13:25:07.675507500 -0400
+++ c-parse.in 2003-09-30 13:23:28.121363000 -0400
@@ -2561,13 +2561,16 @@ parmlist_2: /* empty */
tries to verify that BUILT_IN_NEXT_ARG is being used
correctly. */
error ("ISO C requires a named argument before `...'");
+ parsing_iso_function_signature = true;
}
| parms
{ $$ = get_parm_info (1);
parsing_iso_function_signature = true;
}
| parms ',' ELLIPSIS
- { $$ = get_parm_info (0); }
+ { $$ = get_parm_info (0);
+ parsing_iso_function_signature = true;
+ }
;
parms:
--- testsuite/gcc.dg/Wold-style-definition-1.c.orig 2003-09-30 13:27:01.550387000 -0400
+++ testsuite/gcc.dg/Wold-style-definition-1.c 2003-09-30 13:30:06.948825500 -0400
@@ -22,3 +22,10 @@ void bar4 (a) {} /* { dg-warning "old-st
void bar5 (int a) {}
void bar6 (void) {}
+
+void bar7 ( ... ) {} /* { dg-error "ISO C requires a named argument" } */
+
+void bar8 (int a, ... ) {}
+
+void bar9 (a, ... ) {} /* { dg-warning "old-style parameter declaration" } */
+