aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/cpp.texi
diff options
context:
space:
mode:
authorNeil Booth <neil@gcc.gnu.org>2003-05-04 20:03:55 +0000
committerNeil Booth <neil@gcc.gnu.org>2003-05-04 20:03:55 +0000
commita8eb6044a9468a56cab63890820e17101ce8fd64 (patch)
treedb0e598a611fbe90ebcaf267b9665fd02c67a70f /gcc/doc/cpp.texi
parent09780dfb652960d422da1c5a9d81dc536cdf09f4 (diff)
downloadgcc-a8eb6044a9468a56cab63890820e17101ce8fd64.zip
gcc-a8eb6044a9468a56cab63890820e17101ce8fd64.tar.gz
gcc-a8eb6044a9468a56cab63890820e17101ce8fd64.tar.bz2
cppinit.c (cpp_create_reader, [...]): Warn about trigraphs unless explicity set or -trigraphs.
* cppinit.c (cpp_create_reader, post_options): Warn about trigraphs unless explicity set or -trigraphs. * cpplex.c (warn_in_comment): New. (_cpp_process_line_notes): Better handling of -Wtrigraphs. (_cpp_skip_block_comment): Add call to _cpp_process_line_notes. * doc/cppopts.texi, doc/cpp.texi: Update. testsuite: * gcc.dg/cpp/Wtrigraphs.c: Update. * gcc.dg/cpp/Wtrigraphs-2.c: New tests. From-SVN: r66459
Diffstat (limited to 'gcc/doc/cpp.texi')
-rw-r--r--gcc/doc/cpp.texi22
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index cf962c4..173e341 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -293,16 +293,18 @@ obsolete systems that lack some of C's punctuation to use C@. For
example, @samp{??/} stands for @samp{\}, so @t{'??/n'} is a character
constant for a newline.
-Trigraphs are not popular and many compilers implement them incorrectly.
-Portable code should not rely on trigraphs being either converted or
-ignored. If you use the @option{-Wall} or @option{-Wtrigraphs} options,
-GCC will warn you when a trigraph would change the meaning of your
-program if it were converted.
-
-In a string constant, you can prevent a sequence of question marks from
-being confused with a trigraph by inserting a backslash between the
-question marks. @t{"(??\?)"} is the string @samp{(???)}, not
-@samp{(?]}. Traditional C compilers do not recognize this idiom.
+Trigraphs are not popular and many compilers implement them
+incorrectly. Portable code should not rely on trigraphs being either
+converted or ignored. With @option{-Wtrigraphs} GCC will warn you
+when a trigraph may change the meaning of your program if it were
+converted. @xref{Wtrigraphs}.
+
+In a string constant, you can prevent a sequence of question marks
+from being confused with a trigraph by inserting a backslash between
+the question marks, or by separating the string literal at the
+trigraph and making use of string literal concatenation. @t{"(??\?)"}
+is the string @samp{(???)}, not @samp{(?]}. Traditional C compilers
+do not recognize these idioms.
The nine trigraphs and their replacements are