This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ATTRIBUTE_WEAK


> 
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]