Solaris2.7 bootstrap failure, cc cannot compile cpplex.c
Zack Weinberg
zack@wolery.cumb.org
Mon Jul 10 18:35:00 GMT 2000
On Mon, Jul 10, 2000 at 10:41:24AM -0400, Kaveh R. Ghazi wrote:
> Hi Zack,
>
> When I compile cpplex.c on solaris2.7 using cc (WorkShop
> Compilers 4.2), I get:
>
> > cc -c -DIN_GCC -DSVR4 -g -DHAVE_CONFIG_H
> > -I. -I../../egcs-CVS20000710/gcc
> > -I../../egcs-CVS20000710/gcc/config
> > -I../../egcs-CVS20000710/gcc/../include
> > ../../egcs-CVS20000710/gcc/cpplex.c
> > "../../egcs-CVS20000710/gcc/cpplex.c", line 172: non-constant initializer: op "+"
...
> I believe the cause is the macro definition of T() in cpplex.c which
> is "U STRINGX(e) + 4". This appears to be done to remove the CPP_
> prefix from the entries in TTYPE_TABLE.
Yup.
> I think if you instead create the entries in TTYPE_TABLE without
> CPP_ and prepend CPP_ using CONCAT2 when desired it will probably
> fix the problem.
There was some reason why that wasn't done in the first place. I
probably didn't want to drag symcat.h into every user of cpplib.h.
> Or we could just take out the "+ 4" since its just for debugging
> output printing (right?)
It's also being used for error messages now - but only ICE messages, I
think. (Grep for _cpp_spell_operator()) And this is purely cosmetic,
so...
> Does either approach sound okay with you?
Let's take out the + 4. Would you mind generating a patch to that
effect? I have too many untested changes in my own tree right now,
and you can test the patch directly where I can't. Consider it
pre-approved.
zw
More information about the Gcc-bugs
mailing list