diff options
author | Richard Henderson <rth@redhat.com> | 2004-02-20 10:42:51 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-02-20 10:42:51 -0800 |
commit | 7c4d376d4fa0dac8d3039a01c3c8b6fde1eb201d (patch) | |
tree | e63505ff365ffe9f5f69d3b257ab01e28e63bff8 /gcc | |
parent | 821b56cbd610e045d66c9327fc259711f9fab5f1 (diff) | |
download | gcc-7c4d376d4fa0dac8d3039a01c3c8b6fde1eb201d.zip gcc-7c4d376d4fa0dac8d3039a01c3c8b6fde1eb201d.tar.gz gcc-7c4d376d4fa0dac8d3039a01c3c8b6fde1eb201d.tar.bz2 |
* doc/invoke.texi: Add -Wvariadic-macros.
From-SVN: r78179
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c | 6 |
6 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 993c116..6d85b30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2004-02-20 Richard Henderson <rth@redhat.com> + + * doc/invoke.texi: Add -Wvariadic-macros. + 2004-02-20 Kazu Hirata <kazu@cs.umass.edu> * haifa-sched.c (sched_emit_insn): Remove. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 85912ab..1b6b8c4 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -232,7 +232,8 @@ in the following sections. -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} +-Wunused-value -Wunused-variable -Wwrite-strings @gol +-Wvariadic-macros} @item C-only Warning Options @gccoptlist{-Wbad-function-cast -Wmissing-declarations @gol @@ -2963,6 +2964,13 @@ 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 Warn if a requested optimization pass is disabled. This warning does diff --git a/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c b/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c new file mode 100644 index 0000000..88e2793 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c @@ -0,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; diff --git a/gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c b/gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c new file mode 100644 index 0000000..f72e311 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c @@ -0,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; diff --git a/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c b/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c new file mode 100644 index 0000000..056af83 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c @@ -0,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; diff --git a/gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c b/gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c new file mode 100644 index 0000000..428365e --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c @@ -0,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; |