This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix __attribute__ for apple broken cpp
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 04 Jan 2002 08:51:43 -0800
- Subject: Re: fix __attribute__ for apple broken cpp
- References: <20020104063725.GA9997@redhat.com>
>>>>> "Aldy" == Aldy Hernandez <aldyh@redhat.com> writes:
> another patch from the stubbort department.
> darwin's cpp expands ATTRIBUTE_UNUSED* macros incorrectly. here is a patch
> to fix it. i'm really hoping later releases of the apple development tools
> will have the preprocessor fixed.
Sorry wrong patch. Here's the real one :)
ok?
2002-01-03 Aldy Hernandez <aldyh@redhat.com>
* include/ansidecl.h: Define __attribute__ empty for older
versions of Apple's cc.
Index: ansidecl.h
===================================================================
RCS file: /cvs/gcc/gcc/include/ansidecl.h,v
retrieving revision 1.13
diff -c -p -r1.13 ansidecl.h
*** ansidecl.h 2001/08/29 19:44:39 1.13
--- ansidecl.h 2002/01/04 16:29:55
*************** So instead we use the macro below and te
*** 239,244 ****
--- 239,253 ----
# define __attribute__(x)
#endif
+ /* Note: some versions of MacOS X claim to be gcc, but have a hacked
+ up preprocessor which will miscompile attributes. */
+
+ #ifdef __APPLE_CC__
+ #if (__APPLE_CC__ < 950)
+ #define __attribute__(x)
+ #endif
+ #endif
+
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
#ifndef ATTRIBUTE_MALLOC
# if (GCC_VERSION >= 2096)