This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.
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()
{
}
-----
extern void foo();
bar()
{
if (foo) foo();
}
-----
NOTE: I do not truly understand weak symbols, but I'm pretty sure it's
the definition that gets weakend (so it can be overridden) rather than
the reference (if the reference, would that be so the definition is
optional???).
Bill
--
Leave others their otherness