mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-10 03:36:46 +08:00
cpplex.c (trigraph_ok): Ensure we don't warn twice.
* cpplex.c (trigraph_ok): Ensure we don't warn twice. * cpplib.h (struct cpp_buffer): New member last_Wtrigraphs. From-SVN: r37669
This commit is contained in:
parent
a165f034f9
commit
4a5b68a2f7
@ -1,3 +1,8 @@
|
||||
2000-11-22 Neil Booth <neilb@earthling.net>
|
||||
|
||||
* cpplex.c (trigraph_ok): Ensure we don't warn twice.
|
||||
* cpplib.h (struct cpp_buffer): New member last_Wtrigraphs.
|
||||
|
||||
2000-11-22 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* haifa-sched.c (sched_analyze_1): Don't special-case calls
|
||||
|
10
gcc/cpplex.c
10
gcc/cpplex.c
@ -159,9 +159,13 @@ trigraph_ok (pfile, from_char)
|
||||
"trigraph ??%c converted to %c",
|
||||
(int) from_char,
|
||||
(int) _cpp_trigraph_map[from_char]);
|
||||
else
|
||||
cpp_warning_with_line (pfile, buffer->lineno, CPP_BUF_COL (buffer) - 2,
|
||||
"trigraph ??%c ignored", (int) from_char);
|
||||
else if (buffer->cur != buffer->last_Wtrigraphs)
|
||||
{
|
||||
buffer->last_Wtrigraphs = buffer->cur;
|
||||
cpp_warning_with_line (pfile, buffer->lineno,
|
||||
CPP_BUF_COL (buffer) - 2,
|
||||
"trigraph ??%c ignored", (int) from_char);
|
||||
}
|
||||
}
|
||||
|
||||
return accept;
|
||||
|
@ -282,6 +282,10 @@ struct cpp_buffer
|
||||
/* Line number at line_base (above). */
|
||||
unsigned int lineno;
|
||||
|
||||
/* Because of the way the lexer works, -Wtrigraphs can sometimes
|
||||
warn twice for the same trigraph. This helps prevent that. */
|
||||
const unsigned char *last_Wtrigraphs;
|
||||
|
||||
/* True if we have already warned about C++ comments in this file.
|
||||
The warning happens only for C89 extended mode with -pedantic on,
|
||||
or for -Wtraditional, and only once per file (otherwise it would
|
||||
|
Loading…
Reference in New Issue
Block a user