This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13134] [3.4 regression] Visibility attribute is ignored
- From: "geoffk at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2003 22:08:40 -0000
- Subject: [Bug c/13134] [3.4 regression] Visibility attribute is ignored
- References: <20031120005743.13134.bryner@brianryner.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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