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 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


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