diff options
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index bd68911..3d1fd92 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -3880,6 +3880,10 @@ do_warning (pfile, keyword, buf, limit) bcopy (buf, copy, length); copy[length] = 0; SKIP_WHITE_SPACE (copy); + + if (CPP_PEDANTIC (pfile) && !CPP_BUFFER (pfile)->system_header_p) + cpp_pedwarn ("ANSI C does not allow `#warning'"); + /* Use `pedwarn' not `warning', because #warning isn't in the C Standard; if -pedantic-errors is given, #warning should cause an error. */ cpp_pedwarn (pfile, "#warning %s", copy); |