This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -Dgnu_{linux,hurd}
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- To: Andi Kleen <ak at suse dot de>,Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Apr 2002 22:10:15 +0200
- Subject: Re: -Dgnu_{linux,hurd}
- References: <Pine.LNX.4.33.0204132147050.22725-100000@kern.srcf.societies.cam .ac.uk.suse.lists.egcs-bugs> <61690000.1018898648@gandalf.codesourcery.com.suse.lists.egcs-bugs> <p73ofgkagvc.fsf@oldwotan.suse.de>
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.