cppinit.c (cpp_handle_option): Suppress warnings with an implicit "-w" for "-M" and...
authorNeil Booth <neil@daikokuya.co.uk>
Tue, 2 Jul 2002 17:06:03 +0000 (17:06 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Tue, 2 Jul 2002 17:06:03 +0000 (17:06 +0000)
* cppinit.c (cpp_handle_option):  Suppress warnings with an
implicit "-w" for "-M" and "-MM".
doc:
* cppopts.texi: Update.
testsuite:
* gcc.dg/cpp/cmdlne-M.c: New test.

From-SVN: r55185

gcc/ChangeLog
gcc/doc/cppopts.texi
gcc/testsuite/gcc.dg/cpp/cmdlne-M.c [new file with mode: 0644]

index 4a6723d888cb54f0071eca2ccf3c1da314d0c465..654fd39e86335c03368563f4300db227d280bbc8 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-02  Neil Booth  <neil@daikokuya.co.uk>
+
+       * cppinit.c (cpp_handle_option):  Suppress warnings with an
+       implicit "-w" for "-M" and "-MM".
+       * doc/cppopts.texi: Update.
+
 2002-07-01  Roger Sayle  <roger@eyesopen.com>
 
        * config/sh/sh.c (sh_media_init_builtins): Change use of poisoned
index 7a2ce50cc3fceaa42e059faaca049fd690aed34b..3f1e98cd20170550e3c6ca727188ccf469a813a1 100644 (file)
@@ -178,7 +178,8 @@ rules you should explicitly specify the dependency output file with
 @env{DEPENDENCIES_OUTPUT} (@pxref{Environment Variables}).  Debug output
 will still be sent to the regular output stream as normal.
 
-Passing @option{-M} to the driver implies @option{-E}.
+Passing @option{-M} to the driver implies @option{-E}, and suppresses
+warnings with an implicit @option{-w}.
 
 @item -MM
 @opindex MM
diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-M.c
new file mode 100644 (file)
index 0000000..4eb6407
--- /dev/null
@@ -0,0 +1,8 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.  */
+
+/* { dg-do preprocess } */
+/* { dg-options "-M" } */
+
+/* Test that dependency output suppresses warnings by implying -w.  */
+
+#warning bogus /* { dg-bogus "warning" "warning not suppressed" } */