This is the mail archive of the gcc-bugs@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]

[Bug c/13134] [3.4 regression] Visibility attribute is ignored


------- Additional Comments From geoffk at gcc dot gnu dot org  2003-11-24 22:08 -------
I think Bryan's testcase,

int i __attribute__((visibility ("hidden")));
int i __attribute__((visibility ("default"))) = 5;

should be an error.  Between the declarations, GCC will generate code based on the assumption 
that 'i' is defined in this shared object, which will be wrong.

ISO C makes similar constructs undefined behaviour for exactly this reason:

> If, within a translation unit, the same identifier appears with both internal and external linkage, 
the behavior is undefined. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13134


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