This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Get rid of -trigraphs?
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 30 May 2002 10:34:34 -0700
- Subject: Re: Get rid of -trigraphs?
- References: <20020530060717.GC2275@daikokuya.demon.co.uk>
On Thu, May 30, 2002 at 07:07:18AM +0100, Neil Booth wrote:
> I'm seriously considering getting rid of the -trigraphs option.
>
> I believe this was mainly added to cccp as an optimization, though
> possibly a political statement as well, because cccp did a separate
> trigraph conversion pass on the whole file which could be skipped if
> we weren't going to honour them. There is no longer any separate pass,
> so there is nothing to gain any more. There is only added complexity.
I don't think this is a good idea in general. I think there are lots
of people out there counting on GCC not converting trigraphs - mainly,
possibly exclusively - in string constants, but still. Yeah, their
code is unportable, but I am not convinced we gain much of anything by
breaking it.
Now, if we can *prove* that there is no C program, that contains a
trigraph other than ??/ outside a string constant, which has a valid
stage-7 parse when the trigraph is not converted, and additionally if
it causes *major* improvements to the simplicity of your planned new
lexer, then I wouldn't have a problem with silently converting
those trigraphs outside string constants. I think ??/ outside a
string constant should still be warned about and ignored by default.
I think it's not going to be much of a win though. You're still stuck
with all the complexity of \-newline and ??/-newline.
zw