This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR C/12466 (take 2)


On Tue, 30 Sep 2003 11:09:51 -0700, Andrew Pinski wrote:

>> +void bar9 (a, ... ) {} /* { dg-warning "old-style parameter 
>> declaration" } */
>I think this should have been here because it does not work.

>Thanks,
>Andrew Pinski

You are obviously right; that final test doesn't work.

OK without that final test?

Bootstrapped (-Wold-style-definitions) and regtested on i686-pc-cygwin

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 2 ellipsis testcases.

Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.185
diff -c -p -r1.185 c-parse.in
*** c-parse.in	25 Sep 2003 07:17:02 -0000	1.185
--- c-parse.in	1 Oct 2003 02:07:12 -0000
*************** parmlist_2:  /* empty */
*** 2561,2573 ****
  		     tries to verify that BUILT_IN_NEXT_ARG is being used
  		     correctly.  */
  		  error ("ISO C requires a named argument before `...'");
  		}
  	| parms
  		{ $$ = get_parm_info (1);
  		  parsing_iso_function_signature = true;
  		}
  	| parms ',' ELLIPSIS
! 		{ $$ = get_parm_info (0); }
  	;
  
  parms:
--- 2561,2576 ----
  		     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);
! 		  parsing_iso_function_signature = true;
! 		}
  	;
  
  parms:
Index: testsuite/gcc.dg/Wold-style-definition-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/Wold-style-definition-1.c,v
retrieving revision 1.1
diff -c -p -r1.1 Wold-style-definition-1.c
*** testsuite/gcc.dg/Wold-style-definition-1.c	15 Sep 2003 09:31:16 -0000	1.1
--- testsuite/gcc.dg/Wold-style-definition-1.c	1 Oct 2003 02:07:12 -0000
*************** void bar4 (a) {} /* { dg-warning "old-st
*** 22,24 ****
--- 22,28 ----
  void bar5 (int a) {}
  
  void bar6 (void) {}
+ 
+ void bar7 ( ... ) {} /* { dg-error "ISO C requires a named argument" } */
+ 
+ void bar8 (int a, ... ) {}




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]