This is the mail archive of the gcc@gcc.gnu.org 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]

Re: MIPS port and fixincludes



Zack Weinberg writes:
 > > That said, the mips port defines __mips in all cases.  It also
 > > defines __mips__ in the case where host or target is openbsd.
 > 
 > Hm - sounds like the existing behavior may be incorrect, not just
 > overenthusiastic.

Hm, no, more likely my analysis was wrong, since this stuff _does_
work.  I've gone back and looked at actual output.  The mips
port always defines __mips__ too, due to the 'P' spec (the 
mips port predefines "mips" which gets turned into "__mips"
and "__mips__" by the 'P' spec).  So this section of fixincludes
is just overenthusiastic, not incorrect.

 > appended - comments?

I think this section should only bother transforming identifiers
that arn't already in the ansi reserved namespace.  You started
down this trail by not transforming id's starting with more than
one underscore, but names starting with one underscore and an
uppercase letter (like "_MIPSEB") are also already in the ansi
reserved space.
 
Also, it makes sense to me that, if fixincludes is going to make
these ansi-fy-ing transformations, it should make the same ones 
that the 'P' spec does.  The 'P' spec transforms the id "_mips" into 
"___mips__" and "___mips" (each starting with three underscores).
This was perhaps just an accedent of implementation rather than a
deliberate choice, and perhaps this needs re-evaluating, but
if it was a deliberate choice then fixincludes should make
the same transformation.  The comments in gcc.c tend to give
precidence to the  "foo" -> "__foo__" transformation, rather
than the "foo" -> "__foo" transformation.

                                            -gavin...


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