This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -traditional comment elimination (yuk...)
- To: Dave Brolley <brolley at redhat dot com>
- Subject: Re: -traditional comment elimination (yuk...)
- From: Neil Booth <NeilB at earthling dot net>
- Date: Fri, 12 May 2000 06:57:46 +0900
- Cc: Zack Weinberg <zack at wolery dot cumb dot org>, gcc at gcc dot gnu dot org
- References: <E12pqC9-0007mW-00@monkey.rosenet.ne.jp> <391AD674.91447010@redhat.com>
Dave Brolley wrote:-
> #if 1 &/**/& 1
>
> causes an error because the #if line is interpreted right away by
> the preprocessor as <#><if><1><&><&><1> and is never re-lexed by
> the compiler.
It looks like current releases don't have this correct, then - I
tested this on 2.95.2 and there was no error (it uses cccp, right?)
and the #if was entered.
Just exactly how much of this do we want to get right? Everything?
Because getting the two cases of && you offered right means that cpp
and front ends will not be able to share their view of the token
streams (i.e. they cannot be easily integrated). It looks very
unpleasant, to say the least.
> It's kind of a catch 22. A token based integrated preprocessor
> makes it easy to implement ANSI but hard to implement
> --traditional. A text based two pass preprocessor/compiler makes
> it easy to implement -traditional. I found this to be one of the
> trickiest areas of the last preprocessor I worked on.
It's going to be very hard to get right, and unfortunately it looks
like supporting -traditional is going to impede performance of the
common, non-traditional, case. This is not what I really wanted.
Neil.