This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: trigraph ... ignored
On Wed, Jun 14, 2000 at 08:42:26PM +0100, Nix wrote:
> Zack Weinberg writes:
> > On Wed, Jun 14, 2000 at 12:46:00AM +0100, Nix wrote:
> > > Thorsten Kranzkowski <th@Marvin.DL8BCU.ampr.org> writes:
> > > > I don't exactly know what trigraphs are, I assume some weird
> > > > replacement expression for unusual characters. But I don't
> > > > think gcc should warn about them in _comments_ !
>
> Why, thank you :) I was just trying to take some load off you (who
> normally explains these things); after all, you have the new
> preprocessor to write, you don't have time to explain the infelicities
> of the old one to all and sundry :)
I do appreciate that.
...
> I *thought* that was odd, but I thought there might be a political
> reason. i.e. `trigraphs suck so we should deprecate them and warn about
> them at every opportunity'. (The entirely correct comment in the gcc
> manual under -trigraphs also tends to support this view.)
>
> Of course, inside a comment trigraphs're *likely* to be harmless, but
> ??/ in particular might have unexpected effects. However, the case in
> which it does is so rare and contrived that we can probably ignore it.
There's no political reason I know of. I suspect that cccp's default
of silently ignoring them might have been political, but that was
before my time.
Trigraphs themselves are not that evil IMO. They are a solution to a
real problem; there are plenty of better solutions, but if you're
going to pick on the C standard there's loads of worse problems to
pick on. They get a bad rap because (a) they mess with your strings,
and (b) they let you write backslash-newline monstrosities in new and
amusing ways. (a) is a legitimate complaint; (b) is more properly
blamed on backslash-newline, which has genuinely awful semantics. If
the standard had chosen for it to be replaced by whitespace, the world
would be a better place.
zw