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: Implement -Wno-variadic-macros


On Thu, Feb 19, 2004 at 11:40:37PM +0000, Joseph S. Myers wrote:
> This patch is missing both documentation and testcases.

I did forget the docs.  I had thought that there would be an
existing testcase for the variadic macro warnings, and so the
bootstrap itself would take care of the rest.  That turns out
to not be true, so I added some.


r~


        * doc/invoke.texi: Add -Wvariadic-macros.
	* gcc.dg/cpp/Wvariadic-1.c: New.
	* gcc.dg/cpp/Wvariadic-2.c: New.
	* gcc.dg/cpp/Wvariadic-3.c: New.
	* gcc.dg/cpp/Wvariadic-4.c: New.

Index: gcc/doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.409
diff -c -p -d -r1.409 invoke.texi
*** gcc/doc/invoke.texi	17 Feb 2004 16:46:25 -0000	1.409
--- gcc/doc/invoke.texi	20 Feb 2004 18:40:44 -0000
*************** in the following sections.
*** 232,238 ****
  -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
  -Wunknown-pragmas  -Wunreachable-code @gol
  -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
! -Wunused-value  -Wunused-variable  -Wwrite-strings}
  
  @item C-only Warning Options
  @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
--- 232,239 ----
  -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized @gol
  -Wunknown-pragmas  -Wunreachable-code @gol
  -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
! -Wunused-value  -Wunused-variable  -Wwrite-strings @gol
! -Wvariadic-macros}
  
  @item C-only Warning Options
  @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
*************** Warn if @samp{long long} type is used.  
*** 2962,2967 ****
--- 2963,2975 ----
  the warning messages, use @option{-Wno-long-long}.  Flags
  @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
  only when @option{-pedantic} flag is used.
+ 
+ @item -Wvariadic-macros
+ @opindex Wvariadic-macros
+ @opindex Wno-variadic-macros
+ Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
+ alternate syntax when in pedantic ISO C99 mode.  This is default.
+ To inhibit the warning messages, use @option{-Wno-variadic-macros}.
  
  @item -Wdisabled-optimization
  @opindex Wdisabled-optimization
Index: gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c
===================================================================
RCS file: gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c
diff -N gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c	20 Feb 2004 18:40:44 -0000
***************
*** 0 ****
--- 1,6 ----
+ /* { dg-do compile } */
+ /* { dg-options "-std=iso9899:1990 -pedantic -Werror" } */
+ 
+ #define f(x,...)	/* { dg-error "variadic" } */
+ #define g(x,y...)	/* { dg-error "variadic" } */
+ int not_empty;
Index: gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c
===================================================================
RCS file: gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c
diff -N gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c	20 Feb 2004 18:40:44 -0000
***************
*** 0 ****
--- 1,6 ----
+ /* { dg-do compile } */
+ /* { dg-options "-std=iso9899:1990 -pedantic -Werror -Wno-variadic-macros" } */
+ 
+ #define f(x,...)	/* { dg-bogus "variadic" } */
+ #define g(x,y...)	/* { dg-bogus "variadic" } */
+ int not_empty;
Index: gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c
===================================================================
RCS file: gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c
diff -N gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c	20 Feb 2004 18:40:44 -0000
***************
*** 0 ****
--- 1,6 ----
+ /* { dg-do compile } */
+ /* { dg-options "-std=iso9899:1999 -pedantic -Werror" } */
+ 
+ #define f(x,...)
+ #define g(x,y...)	/* { dg-error "variadic" } */
+ int not_empty;
Index: gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c
===================================================================
RCS file: gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c
diff -N gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c	20 Feb 2004 18:40:44 -0000
***************
*** 0 ****
--- 1,6 ----
+ /* { dg-do compile } */
+ /* { dg-options "-std=iso9899:1999 -pedantic -Werror -Wno-variadic-macros" } */
+ 
+ #define f(x,...)
+ #define g(x,y...)
+ int not_empty;


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