This is the mail archive of the 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]
Other format: [Raw text]

Re: Get rid of -trigraphs?

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.


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