This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ATTRIBUTE_WEAK
- To: bcurrie at tssc dot co dot nz (Bill Currie)
- Subject: Re: ATTRIBUTE_WEAK
- From: hjl at lucon dot org (H.J. Lu)
- Date: Wed, 24 Feb 1999 12:53:22 -0800 (PST)
- Cc: law at cygnus dot com, egcs at egcs dot cygnus dot com
>
> H.J. Lu wrote:
> > extern void foo () __attribute__ ((weak));
> >
> > bar ()
> > {
> > if (foo) foo ();
> > }
>
> Correct me if I'm wrong, but isn't __attribute__ ((weak)) for when you
> *define* a function, rather than reference it? For your example, my
> understanding says that the following is something closer to what's
> intended:
>
> -----
> void __attribute__((weak)) foo()
> {
> }
>
That is not what we want. We want something like
#pragma weak foo
extern void foo ();
Can __attribute__ do it?
H.J.