From 49e7b251ee93b18e852eb2b4e328b1094edd93a4 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Tue, 2 Jul 2002 17:06:03 +0000 Subject: [PATCH] cppinit.c (cpp_handle_option): Suppress warnings with an implicit "-w" for "-M" and "-MM". * 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 | 6 ++++++ gcc/doc/cppopts.texi | 3 ++- gcc/testsuite/gcc.dg/cpp/cmdlne-M.c | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/cpp/cmdlne-M.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a6723d888c..654fd39e863 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-07-02 Neil Booth + + * cppinit.c (cpp_handle_option): Suppress warnings with an + implicit "-w" for "-M" and "-MM". + * doc/cppopts.texi: Update. + 2002-07-01 Roger Sayle * config/sh/sh.c (sh_media_init_builtins): Change use of poisoned diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi index 7a2ce50cc3f..3f1e98cd201 100644 --- a/gcc/doc/cppopts.texi +++ b/gcc/doc/cppopts.texi @@ -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 index 00000000000..4eb6407cdd0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-M.c @@ -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" } */