warning: trigraph ... ignored - again

Zack Weinberg zack@wolery.cumb.org
Thu Jun 15 10:04:00 GMT 2000

On Thu, Jun 15, 2000 at 04:49:21PM +0000, Thorsten Kranzkowski wrote:
> Hello again!
> It seems that gcc shouldn't warn about trigraphs at all because it shouldn't 
> care about them by default. Neither -ansi nor -trigraph were passed to gcc
> so trigraph processing is disabled (or should be...).
> ----- Forwarded message from "H. Peter Anvin" <hpa@zytor.com> -----

[snip documentation quote]

> > We don't *want* trigraphs, since they invoke behaviour that is
> > generally unexpected.  There is nothing on that command line that
> > should have turned trigraphs on.  Thus, I conclude that the
> > -Wtrigraphs option is broken in the version of gcc you're using (2.96,
> > right?) and that this bug should be reported.

The documentation is out of date.  -Wtrigraphs has been included in
-Wall for a long time, but no one noticed because it didn't do
anything when trigraphs were disabled.  We felt that they were a
common enough portability problem that they should be warned about
even when they were disabled; the new preprocessor is capable of this.

Trigraphs are still not enabled unless you put -trigraphs or -ansi on
the command line.  The warning message

test.c:2:2: warning: trigraph ??/ ignored

was intended to make this obvious.  If trigraphs are enabled, you get
a different message:

test.c:2:2: warning: trigraph ??/ converted to \

Suggestions for better wording would be appreciated.

In the near future, gcc will stop warning about trigraphs in comments,
which represent the vast majority of trigraphs in the kernel source.
(This is not possible right now because the trigraph converter doesn't
know about comments.)  I'd recommend that you ignore the issue for


More information about the Gcc mailing list