This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[OT] Re: System header #define'ing __attribute__
- From: Gabriel Paubert <paubert at iram dot es>
- To: Jeff Epler <jepler at unpythonic dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 2 Apr 2003 09:40:41 +0200
- Subject: [OT] Re: System header #define'ing __attribute__
- References: <20030401235338.GB30045@unpythonic.net>
On Tue, Apr 01, 2003 at 05:53:38PM -0600, Jeff Epler wrote:
> I'm trying to compile gcc3.2 on bsdi2.1. Yes, I know it's an obsolete
> platform.
>
> I run into problems because in <sys/cdefs.h> there's the following:
> /*
> * GCC1 and some versions of GCC2 declare dead (non-returning) and
> * pure (no side effects) functions using "volatile" and "const";
> * unfortunately, these then cause warnings under "-ansi -pedantic".
> * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
> * these work for GNU C++ (modulo a slight glitch in the C++ grammar
> * in the distribution version of 2.5.5).
> */
> #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5
> #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
>
Of course they never considered that GCC with major version
number higher than 2 could happen at some point :-(
> now, of course, this worked great for any gcc 2.x version, but not for
> any gcc 3.x version. As it is, stuff in libgcc is built with
^^^
Until gcc3.5 is out.
The version checking is bogus for any major >=3, the last part should
be "|| ( __GNUC__ == 2 && __GNUC_MINOR__ < 5)" or something like this.
> What's the proper way to make gcc aware of this problem and work around
> it?
Fixing the wrong headers... It's not GCC's fault at all.
Regards,
Gabriel.