OSDN Git Service

* doc/invoke.texi: Add -Wvariadic-macros.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Feb 2004 18:42:51 +0000 (18:42 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Feb 2004 18:42:51 +0000 (18:42 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78179 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c [new file with mode: 0644]

index 993c116..6d85b30 100644 (file)
@@ -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.
index 85912ab..1b6b8c4 100644 (file)
@@ -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 (file)
index 0000000..88e2793
--- /dev/null
@@ -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 (file)
index 0000000..f72e311
--- /dev/null
@@ -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 (file)
index 0000000..056af83
--- /dev/null
@@ -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 (file)
index 0000000..428365e
--- /dev/null
@@ -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;