aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-11-22 20:36:10 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-11-22 20:36:10 +0000
commit4a5b68a2f743ff0742b64c97bb75e6ee0c3c1471 (patch)
tree2ae21a5cad4b86f0223248b6d989593f99c8520f /gcc/cpplex.c
parenta165f034f9475245783ff7949b28ee3134bcc21a (diff)
downloadgcc-4a5b68a2f743ff0742b64c97bb75e6ee0c3c1471.zip
gcc-4a5b68a2f743ff0742b64c97bb75e6ee0c3c1471.tar.gz
gcc-4a5b68a2f743ff0742b64c97bb75e6ee0c3c1471.tar.bz2
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
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 96e2454..bec14e7 100644
--- a/gcc/cpplex.c
+++ b/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;