This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: warning: trigraph ... ignored - again


Zack Weinberg wrote:
> 
> 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.

That's the point, exactly.  You broke the old behaviour by changing the
meaning of -Wtrigraphs.  This is *not* appreciated.

> 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.

If so, you should have made it another option.
 
> 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. 

This whole thing breaks backwards compatibility with old versions of
gcc, mostly because you didn't put in the rather necessary -no-trigraphs
option a long time ago (in which case -no-trigraphs -Wno-trigraphs would
make perfect sense.)  I definitely would want a warning if I
accidentally enabled trigraphs in my code, but if I have to shut up the
bogus warning I can't get the real warning.  What you're describing
above are two very differernt warnings, one of which is harmless and one
of which is critical.

> 
> 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
> now.
> 

I think you seriously need to re-think your design.  You have broken old
behaviour and bundled a low-priority warning with a high-priority
warning that can't be switched on or off as a group.  I think that's a
major lose.

	-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]