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


On Tue, Jan 18, 2000 at 12:55:28PM -0800, Bruce Korb wrote:
> Zack Weinberg wrote:
> > 
> > On Tue, Jan 18, 2000 at 01:24:29PM -0500, Gavin Romig-Koch 
> > >
> > > I think fixincludes should do as little as resonably possible
> > > (for some definition of reasonable).
> > 
> > I'm looking through the machine_name fixes applied on this machine
> > (bleeding edge linux distribution) and all of them are unnecessary,
> > or at least questionable.  Examples: [[deleted]]
> > 
> > I'm half tempted to say we should discard this fix entirely and say
> > that if your vendor provides broken headers, -ansi may not work, sorry.
> 
> Since most vendors distribute broken headers,
> that would mean that -ansi is broken for everything
> except Linux and the latest SVR4.2+.

Not so.  Look at the list of systems that use a specialized script
(except fixinc.svr4) or no fixincludes at all:

interix netbsd openbsd solaris2 winnt sequent sco irix alpha-vms
convex hppa-{bsd,lites} hurd moss osf1 cygwin mingw32 win32 uwin linux
(not i386)

None of those need machine_name munging.

>  I really think
> it is useful to be able to get an answer to the question
> 
>   What names are pre-defined for a given target?
> 
> Once that question is easily answered, then set up a
> table of broken ways of spelling each such name.

It's not that hard -

$ ./xgcc -B./ -E -xc -dM /dev/null 2>&1 | cut -d' ' -f2 | sort

__ELF__
__GNUC_MINOR__
__GNUC__
__i386
__i386__
__linux
__linux__
__tune_pentiumpro__
__unix
__unix__
i386
linux
unix

and then you do it again with -ansi and see what goes away.  (Although
-m options might change the list.  Feh.)

> Fixincludes would then fix such misspellings in those headers
> where the correct spelling is absent.  In other words,
> "sparc" would not be corrected on IA86.  It would also
> not be corrected in files that also contain "__sparc__",
> on the assumption that someone had to know what they were
> doing if they had both spellings.  (That may be an incorrect
> assumption 8-O, but a reasonable one without a counter example.)

Seems sane enough; at least, it's provably not worse than what we have
now (on the principle stated by Gavin, that the less we do the
better).  If I get a chance I'll look at this today.

> > I think these were all intended to match the symbol with zero or one
> > leading underscores, not two or more.  Unfortunately, sed doesn't have
> > [[a complete regex capability]] - comments?
> 
> It sure is ugly.
> Do it.

I'll repost the complete patch for one more round of comments before
applying.

zw

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