flags.h: Declare warning flag warn_system_headers.
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.
From-SVN: r36636
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index d6fcf9bf..0616e8a 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -383,8 +383,7 @@
const U_CHAR *str;
int ab;
- if (CPP_OPTION (pfile, warn_import)
- && !CPP_IN_SYSTEM_HEADER (pfile) && !pfile->import_warning)
+ if (!pfile->import_warning && CPP_OPTION (pfile, warn_import))
{
pfile->import_warning = 1;
cpp_warning (pfile,
@@ -801,9 +800,8 @@
/* Allow #pragma once in system headers, since that's not the user's
fault. */
- if (!CPP_IN_SYSTEM_HEADER (pfile))
- cpp_warning (pfile, "#pragma once is obsolete");
-
+ cpp_warning (pfile, "#pragma once is obsolete");
+
if (CPP_PREV_BUFFER (ip) == NULL)
cpp_warning (pfile, "#pragma once outside include file");
else