Subject: Re: gcc3's cpp not defining __GNUC__
To: Martin Husemann <firstname.lastname@example.org>
From: Frederick Bruckman <email@example.com>
Date: 07/21/2003 10:07:47
On Mon, 21 Jul 2003, Martin Husemann wrote:
> On Mon, Jul 21, 2003 at 04:05:29PM +0200, Thomas Klausner wrote:
> > Perhaps checking for __GCC__ is as useful as checking
> > for __unix__ :)
> No. Besides, we are talking about __GNUC__. There are lots of GCC-isms and
> it is only valid to rely on some of them (i.e. the gcc version test) if you
> know you are compiling with gcc. You can write code with safe assumptions
> if you test for gcc and the proper version before (see for example how we
> define the __restrict macro in /usr/include/sys/cdefs.h).
The compiler still does that. For whatever reason, "cpp" does not.
Besides, the only place this causes a problem seems to be in
<sys/cdefs.h>, where the act of *simply* *including* that file causes
"cpp" to return an error. Probably better, would be to have __RENAME()
always do the ELF thing with an unknown compiler, as now that we've
dropped support for NetBSD-a.out, we really don't need to support new,
non-GCC, a.out compilers.