diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-25 22:54:04 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-25 22:54:04 +0000 |
commit | 02c09dabd760c345f88a37352ac537c916cbe1a3 (patch) | |
tree | 7fc11a6b7a593988efb1e370c5443cd4e490aeb4 /gcc/cpperror.c | |
parent | f0495c2c8e7c3c66271599323d04046d84dbae04 (diff) | |
download | gcc-02c09dabd760c345f88a37352ac537c916cbe1a3.tar.gz |
2000-09-25 Branko Cibej <branko.cibej@hermes.si>
* flags.h: Declare warning flag warn_system_headers.
* toplev.c: Define it.
(W_options): Add option -Wsystem-headers.
* diagnostic.c (count_error): Test warn_system_headers.
* invoke.texi: Add description for -Wsystem-headers.
* cpplib.h (cpp_options): New member warn_system_headers.
* cpphash.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Don't test
CPP_IN_SYSTEM_HEADER.
* cpplib.c (do_import, do_pragma_once): Likewise.
* cpperror.c (_cpp_begin_message): Test warn_system_headers
and CPP_IN_SYSTEM_HEADER.
* cppinit.c (handle_option): Recognize -Wsystem_headers.
(print_help): Describe -Wsystem_headers.
* cpplex.c (lex_line): Reorganize condition so that warnings
about C++ comments in system headers can be enabled. Remove
label do_line_comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36636 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpperror.c')
-rw-r--r-- | gcc/cpperror.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cpperror.c b/gcc/cpperror.c index a6c7b2dbf3e..0d6dbfb1a90 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -122,7 +122,9 @@ _cpp_begin_message (pfile, code, file, line, col) case WARNING: if (! CPP_OPTION (pfile, warnings_are_errors)) { - if (CPP_OPTION (pfile, inhibit_warnings)) + if (CPP_OPTION (pfile, inhibit_warnings) + || (CPP_IN_SYSTEM_HEADER (pfile) + && ! CPP_OPTION (pfile, warn_system_headers))) return 0; is_warning = 1; } @@ -138,7 +140,9 @@ _cpp_begin_message (pfile, code, file, line, col) case PEDWARN: if (! CPP_OPTION (pfile, pedantic_errors)) { - if (CPP_OPTION (pfile, inhibit_warnings)) + if (CPP_OPTION (pfile, inhibit_warnings) + || (CPP_IN_SYSTEM_HEADER (pfile) + && ! CPP_OPTION (pfile, warn_system_headers))) return 0; is_warning = 1; } |