summaryrefslogtreecommitdiffstats
path: root/gcc/cpperror.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cpperror.c')
-rw-r--r--gcc/cpperror.c8
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;
}
OpenPOWER on IntegriCloud