This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: gcc -E -traditional broken
- To: Andreas Jaeger <aj at suse dot de>
- Subject: Re: gcc -E -traditional broken
- From: "Zack Weinberg" <zackw at Stanford dot EDU>
- Date: Sun, 10 Dec 2000 11:41:38 -0800
- Cc: Neil Booth <neil at daikokuya dot demon dot co dot uk>, gcc-bugs at gcc dot gnu dot org, libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>
- References: <u8u28c71cx.fsf@gromit.rhein-neckar.de> <20001210180136.B791@daikokuya.demon.co.uk> <u8puj05b1u.fsf@gromit.rhein-neckar.de>
On Sun, Dec 10, 2000 at 08:30:21PM +0100, Andreas Jaeger wrote:
> >>>>> Neil Booth writes:
>
> > Andreas Jaeger wrote:-
> >> t.c:1: Invalid token in expression
> >> # 1 "t.c"
> > [...]
>
> >> t.c is just the following small fragment:
>
> >> #if defined REGPARMS
> >> # warning "quark"
> >> #endif
>
> > It looks to me like traditional cpp has never accepted this syntax.
> > You need to use the "defined (symbol)" syntax; it then works.
>
> > Is this intentional, Zack?
>
> Oh no.
>
> First gcc gets changed and then you tell me to use -traditional to
> work around those problems. Now I'm using -traditional and it fails
> again.:-(.
I *said* it was an oversight.
Hmm... there's code in here that ought to handle 'defined NAME'
(tradcpp.c:special_symbol())
case T_SPEC_DEFINED:
buf = " 0 "; /* Assume symbol is not defined */
ip = &instack[indepth];
SKIP_WHITE_SPACE (ip->bufp);
if (*ip->bufp == '(') {
paren++;
ip->bufp++; /* Skip over the paren */
SKIP_WHITE_SPACE (ip->bufp);
}
if (!is_idstart (*ip->bufp))
goto oops;
if (lookup (ip->bufp, -1, -1))
buf = " 1 ";
while (is_idchar (*ip->bufp))
++ip->bufp;
SKIP_WHITE_SPACE (ip->bufp);
if (paren) {
if (*ip->bufp != ')')
goto oops;
++ip->bufp;
}
break;
I don't have time right now to dig through this and figure out why it
doesn't work, sorry.
zw