]> gcc.gnu.org Git - gcc.git/commitdiff
cpperror.c (print_location): Don't special case <stdin>.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Sun, 8 Apr 2001 10:01:18 +0000 (10:01 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sun, 8 Apr 2001 10:01:18 +0000 (10:01 +0000)
* cpperror.c (print_location): Don't special case <stdin>.
(_cpp_begin_message): Handle WARNING_SYSHDR the same as
WARNING, but we don't check if we're in system headers.
* cpplib.h (enum error_type): WARNING_SYSHDR: New.
* cpplib.c (do_warning): Warn in system headers.

From-SVN: r41186

gcc/ChangeLog
gcc/cpperror.c
gcc/cpphash.h
gcc/cpplib.c

index a0a05757dc8cea6be0fb2d0693826469cee84744..b6eddb5a7a0b4ae2add8c5618052ae11f6a60b51 100644 (file)
@@ -1,3 +1,11 @@
+2001-04-08  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * cpperror.c (print_location): Don't special case <stdin>.
+       (_cpp_begin_message): Handle WARNING_SYSHDR the same as
+       WARNING, but we don't check if we're in system headers.
+       * cpplib.h (enum error_type): WARNING_SYSHDR: New.
+       * cpplib.c (do_warning): Warn in system headers.
+
 2001-04-07  Mumit Khan <khan@NanoTech.Wisc.EDU>
 
        * mbchar.c: Include config.h first.
index 50bd9076dbd82a3c5ad3a2ff777390840ec3dab3..60af7b5dff8d05a91009085b74d53d87dd638d9c 100644 (file)
@@ -124,8 +124,6 @@ print_location (pfile, filename, pos)
 
       if (filename == 0)
        filename = buffer->nominal_fname;
-      if (*filename == '\0')
-       filename = _("<stdin>");
 
       if (line == 0)
        fprintf (stderr, "%s: ", filename);
@@ -159,6 +157,7 @@ _cpp_begin_message (pfile, code, file, pos)
       if (CPP_IN_SYSTEM_HEADER (pfile)
          && ! CPP_OPTION (pfile, warn_system_headers))
        return 0;
+    case WARNING_SYSHDR:
       if (CPP_OPTION (pfile, warnings_are_errors)
          || (code == PEDWARN && CPP_OPTION (pfile, pedantic_errors)))
        {
index 9cac65d64c8ab877602ff9b50ca51c7aab8fb179..cf027f095c6e6b21b8387d33a21bc01da9f03a49 100644 (file)
@@ -389,7 +389,7 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
 #define HASHSTEP(r, c) ((r) * 67 + (c - 113));
 
 /* In cpperror.c  */
-enum error_type { WARNING = 0, PEDWARN, ERROR, FATAL, ICE };
+enum error_type { WARNING = 0, WARNING_SYSHDR, PEDWARN, ERROR, FATAL, ICE };
 extern int _cpp_begin_message PARAMS ((cpp_reader *, enum error_type,
                                       const char *, const cpp_lexer_pos *));
 
index be04d4159254f1821ff99f50c8e39ad24092ff24..bf1a3b07908930b515d0ed0908c11d9a5c083ef8 100644 (file)
@@ -874,7 +874,8 @@ static void
 do_warning (pfile)
      cpp_reader *pfile;
 {
-  do_diagnostic (pfile, WARNING, 1);
+  /* We want #warning diagnostics to be emitted in system headers too.  */
+  do_diagnostic (pfile, WARNING_SYSHDR, 1);
 }
 
 /* Report program identification.  */
This page took 0.077636 seconds and 5 git commands to generate.