This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Can weak references refer to a variable (instead of a function)?


Weak references are explained in section 6.30 of the GCC manual
(Declaring Attributes of Functions).
                         ^^^^^^^^^

The example in that section declares a function x() as a weak reference to some symbol y in another translation unit/object file.

No mention of variables, either as the alias or the symbol referred to.

All of this leads me to understand that weak references apply to functions only.

a. is that true for both the alias and the symbol to which it refers?
b. with respect to the symbol referred to, does it matter what its storage class is (global extent, static local extent or automatic local extent)?


Thanks for any insight,

Erik.


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