From 4a5b68a2f743ff0742b64c97bb75e6ee0c3c1471 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Wed, 22 Nov 2000 20:36:10 +0000 Subject: 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 --- gcc/cpplex.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/cpplex.c') 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; -- cgit v1.1