This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: -Dgnu_{linux,hurd}


On Monday 15 April 2002 21:42, Andi Kleen wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
> > > Yeah, I saw that.  I wanted to make sure I made this point before he
> > > spent too much time on Windows.
> > >
> > > Isn't it likely that there will be a few other systems with the same
> > > needs, too?
> >
> > Let's hope not.  We can always back off as needs be, but hopefully we
> > can eliminate a lot of these. It would certainly help to make programs
> > more portable.
>
> It doesn't look like a good tradeoff for me. I bet there will be much
> more problems with programs breaking on Linux because linux isn't defined
> anymore than the very unlikely case that you have some other system with
> a symbol called linux that means something else.
>
> While it's theoretically correct following POSIX/ANSI-C it doesn't look
> like a very useful change to me in practice.

Well, _nobody_ relies on -Dlinux being in CPP_PREDEFINES (!) at least, 
otherwise we would have been bitten by that on powerpc-linux-gnu. I think 
Zack's patch is just right, there should be near to zero non-__MACRO__ 
defines in CPP_PREDEFINES, if other variations are needed they should go into 
CPP_SPEC manually like we do on PPC-SYSV:

%{!undef:                                                         \
  %{!ansi:                                                        \
    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                   \
    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}               \
-Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"

Franz.


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