public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/33143]  New: preprocess should ignore trigraphs in /* */ comments
@ 2007-08-22  0:34 mec at google dot com
  2007-08-22  0:36 ` [Bug preprocessor/33143] " mec at google dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mec at google dot com @ 2007-08-22  0:34 UTC (permalink / raw)
  To: gcc-bugs

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:

mec@hollerith:~/exp-trigraph$ cat z1.cc
#if 0
??-??-
#endif

/*
??-??-
 */

// ??-??-

mec@hollerith:~/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

mec@hollerith:~/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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-04 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-22  0:34 [Bug preprocessor/33143] New: preprocess should ignore trigraphs in /* */ comments mec at google dot com
2007-08-22  0:36 ` [Bug preprocessor/33143] " mec at google dot com
2007-08-22  0:37 ` pinskia at gcc dot gnu dot org
2007-08-22  1:13 ` joseph at codesourcery dot com
2008-04-04 16:29 ` tromey at gcc dot gnu dot org
2008-04-04 16:36 ` mec at google dot com
2008-04-04 16:40 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).