Commit 1fecc266 by Neil Booth Committed by Neil Booth

* doc/cppopts.texi: Enhance -Wtrigraphs documentation

From-SVN: r66462
parent a8eb6044
2003-05-04 Neil Booth <neil@daikokuya.co.uk>
* 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.
2003-05-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> 2003-05-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* Makefile.in (LIBGCOV): Add _gcov_merge_add. * Makefile.in (LIBGCOV): Add _gcov_merge_add.
......
...@@ -87,12 +87,16 @@ comment, or whenever a backslash-newline appears in a @samp{//} comment. ...@@ -87,12 +87,16 @@ comment, or whenever a backslash-newline appears in a @samp{//} comment.
@item -Wtrigraphs @item -Wtrigraphs
@opindex Wtrigraphs @opindex Wtrigraphs
@anchor{Wtrigraphs} @anchor{Wtrigraphs}
Warn if any trigraphs that may change the meaning of a program are Most trigraphs in comments cannot affect the meaning of the program.
encountered. This option is in effect unless trigraphs are turned on, However, a trigraph that would form an escaped newline (@samp{??/} at
and is implied by @option{-Wall}. With the exception of a trigraph the end of a line) can, by changing where the comment begins or ends.
that would form an escaped newline, warnings are not given for Therefore, only trigraphs that would form escaped newlines produce
trigraphs within comments as they do not affect the meaning of the warnings inside a comment.
program.
This option is implied by @option{-Wall}. If @option{-Wall} is not
given, this option is still enabled unless trigraphs are enabled. To
get trigraph conversion without warnings, but get the other
@option{-Wall} warnings, use @samp{-trigraphs -Wall -Wno-trigraphs}.
@item -Wtraditional @item -Wtraditional
@opindex Wtraditional @opindex Wtraditional
......
2003-05-04 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/Wtrigraphs.c: Update.
* gcc.dg/cpp/Wtrigraphs-2.c: New tests.
2003-05-03 Geoffrey Keating <geoffk@apple.com> 2003-05-03 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/ppc-fsel-1.c: New test. * gcc.dg/ppc-fsel-1.c: New test.
......
/* { dg-do preprocess } */ /* { dg-do preprocess } */
/* { dg-options "-std=c99 -Wtrigraphs -fno-show-column" } */ /* { dg-options "-std=c99 -Wtrigraphs -fno-show-column" } */
/* Test we don't double warn for trigraphs immediately after preceding /* Test warnings for trigraphs in comments, with trigraphs enabled.
text. Source Neil Booth. 4 May 2003. */ Neil Booth. 4 May 2003. */
/* { dg-bogus "ignored" } Test ??< ??= a few ??/ random things in /* { dg-bogus "converted" } Test ??< ??= a few ??/ random things in
{ dg-warning "converted" } some ??/ { dg-warning "converted" } some ??/
{ dg-bogus "ignored" } ??< comments. */ { dg-bogus "converted" } ??< comments. */
// { dg-bogus "ignored" } More ??/ comment ??> tests. // { dg-bogus "converted" } More ??/ comment ??> tests.
// { dg-warning "converted" } Another ??/ // { dg-warning "converted" } Another ??/
Test Test
...@@ -16,5 +16,5 @@ ...@@ -16,5 +16,5 @@
// { dg-warning "converted" } And another with space after ??/ // { dg-warning "converted" } And another with space after ??/
the escape the escape
// { dg-bogus "ignored" } A tricky one ??/\ // { dg-bogus "converted" } A tricky one ??/\
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment