From: Neil Booth Date: Sun, 8 Apr 2001 10:01:18 +0000 (+0000) Subject: cpperror.c (print_location): Don't special case . X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f878973cdb605f01778a5bbd67f7459db14b7ff;p=gcc.git cpperror.c (print_location): Don't special case . * cpperror.c (print_location): Don't special case . (_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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0a05757dc8..b6eddb5a7a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2001-04-08 Neil Booth + + * cpperror.c (print_location): Don't special case . + (_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 * mbchar.c: Include config.h first. diff --git a/gcc/cpperror.c b/gcc/cpperror.c index 50bd9076dbd..60af7b5dff8 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -124,8 +124,6 @@ print_location (pfile, filename, pos) if (filename == 0) filename = buffer->nominal_fname; - if (*filename == '\0') - filename = _(""); 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))) { diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 9cac65d64c8..cf027f095c6 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -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 *)); diff --git a/gcc/cpplib.c b/gcc/cpplib.c index be04d415925..bf1a3b07908 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -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. */