cpplib still warns about trigraphs in comments in 20000505

Jason R Thorpe thorpej@zembu.com
Mon May 8 01:57:00 GMT 2000

Hi folks...

The following illustrates a bug in cpplib where it still warns about
trigraphs in comments if -Wall is enabled.  The code that caused me
to notice this is a piece of code in the NetBSD kernel where the
author was apparently attempting to show puzzlement over something.

  ----- snip -----

/* The following should compile without warnings with `gcc -Wall'.
   The trigraph (which is not intended as a trigraph) in the comment
   should be ignored by CPP.  */

int main() { return (0); } /* (what???) */

  ----- snip -----

With 20000505's CPP:

dr-evil:thorpej 24$ /usr/local/bin/gcc -Wall trigraph-bug.c  
trigraph-bug.c:4:38: warning: trigraph ??) ignored

Since the NetBSD kernel is compiled with -Wall, lots of similar warnings
appear (the comment that produces the trigraph warning is in <sys/device.h>,
which is included by every device driver and by some file system code).

        -- Jason R. Thorpe <thorpej@zembu.com>

More information about the Gcc-bugs mailing list