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


> 
> 
> It just occurred to me why you keep claiming ATTRIBUTE_WEAK is target
> dependent.
> 
> It's the conditions under which ATTRIBUTE_WEAK is supported that is target
> dependent.  Not the attribute itself or the fact that we want to use it
> in a target file..
> 
> I think the way to go is to define/use TARGET_ATTRIBUTE_WEAK instead of
> ATTRIBUTE_WEAK to help make this clear.  I still think this is fine for 
> gansidecl.h in the mainline sources.
> 
> Sorry to have been so dense about this.
> jeff
> 

Could you please show me how to use __attribute__ ((weak))? The code
below doesn't make "foo" weak. BTW,

#pragma weak foo

works fine.
 
Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
extern void foo () __attribute__ ((weak));

bar ()
{
  if (foo) foo ();
}


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