This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: glibc2.1 [offtopic]
- To: hjl at lucon dot org (H.J. Lu)
- Subject: Re: glibc2.1 [offtopic]
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Sun, 21 Feb 1999 19:17:01 -0700
- cc: egcs at egcs dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <m10EkjF-000390C@ocean.lucon.org>you write:
> #if SUPPORT_WEAK
> extern void foo (void) __attribute__ ((weak));
> #endif
>
> That means we need to match foo's prototype in 2 places. We can do
>
> #if SUPPORT_WEAK
> extern void foo (void) __attribute__ ((weak));
> #else
> extern void foo (void);
> #endif
Define an ATTRIBUTE_WEAK then write
extern void foo (void) ATTRIBUTE_WEAK;
This is how we deal with this problem elsewhere. I see no reason for this
code to behave any differently.
> But I don't like it. "#prama weak" is the standard for SVR4 and
> is cleaner than __attribute__ for this case.
But the GNU standard is to use attributes, not pragmas.
Use an attribute please.
jeff