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: "bryner at brianryner dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Nov 2003 08:25:55 -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 bryner at brianryner dot com 2003-11-22 08:25 -------
There's another interesting problem here. Suppose you had (in the global scope):
int i __attribute__((visibility ("hidden")));
int i __attribute__((visibility ("default"))) = 5;
Prior to DECL_VISIBILITY, this would cause i to have default visibility because
the later attribute value would override the earlier one.
To preserve the old behavior, you have to apply the previous decl's visibility
only if visibility was not explicitly set on the new decl. It seems to me that
the only way to do that now would be to either:
a) Find the previous decl and apply its visibility prior to attribute handling
b) Add another bit to say whether visibility was explicitly set on a decl
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13134