This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: gcc -E -traditional broken


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

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