http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html#Warning-Options-Wtrigraphs

-Wtrigraphs
    Warn if any trigraphs are encountered that might change the meaning of the
program (trigraphs within comments are not warned about). This warning is
enabled by -Wall. 

Right now, trigraphs in // comments are not warned about.  Trigraphs in /* */
comments are warned about, but should not be.  Trigraphs in #if 0 ... #endif
are also warned about, but it would probably be too sticky to change that
behavior.

Example:

[EMAIL PROTECTED]:~/exp-trigraph$ cat z1.cc
#if 0
??-??-
#endif

/*
??-??-
 */

// ??-??-

[EMAIL PROTECTED]:~/exp-trigraph$ /home/mec/gcc-4.2.1/install/bin/g++ -E z1.cc
# 1 "z1.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "z1.cc"
z1.cc:2:1: warning: trigraph ??- ignored, use -trigraphs to enable
z1.cc:2:4: warning: trigraph ??- ignored, use -trigraphs to enable

[EMAIL PROTECTED]:~/exp-trigraph$ /home/mec/gcc-4.3-20070810/install/bin/g++ -E
z1.cc
# 1 "z1.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "z1.cc"
z1.cc:2:1: warning: trigraph ??- ignored, use -trigraphs to enable
z1.cc:2:4: warning: trigraph ??- ignored, use -trigraphs to enable


-- 
           Summary: preprocess should ignore trigraphs in /* */ comments
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mec at google dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33143

Reply via email to