Bug 14489

Summary: alternate keywords for visibility attribute
Product: gcc Reporter: Markus Gyger <markus+gcc>
Component: cAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: christian.joensson, gcc-bugs, msebor
Priority: P3 Keywords: visibility
Version: 3.3.2   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2006-01-21 02:57:00

Description Markus Gyger 2004-03-08 20:39:43 UTC
The Sun ONE Studio 8 and Sun Studio 9 compilers on Solaris support the linker
scoping specifiers __global, __hidden and __symbolic which roughly correspond to
gcc's default, hidden and protected visibility attributes. Is there a chance to
have these keywords supported on gcc?  E.g.

__global   void linker_scope_global()   {}
__hidden   void linker_scope_hidden()   {}
__symbolic void linker_scope_symbolic() {}
           void linker_scope_default()  {}

in addition to

__attribute__ ((visibility ("default")))   void linker_scope_global()   {}
__attribute__ ((visibility ("internal")))  void linker_scope_internal() {}
__attribute__ ((visibility ("hidden")))    void linker_scope_hidden()   {}
__attribute__ ((visibility ("protected"))) void linker_scope_symbolic() {}
                                           void linker_scope_default()  {}

The command line option -xldscope={global|hidden|symbolic} allows to set the
default scope. See also:

http://docs.sun.com/source/817-0924/sun.specific.html#83476
http://developers.sun.com/tools/cc/documentation/s1s8cc_documentation/READMEs/c.html#feature13
Comment 1 Andrew Pinski 2004-03-08 20:42:59 UTC
You can use the preprocessor aka '-D__hidden=__attribute__ ((visibility ("hidden")))' as setting what the 
defualt is, I think there is another bug for that.
Comment 2 Andrew Pinski 2004-04-07 02:52:02 UTC
Confirmed, but as I said you can use the preprocessor, just like what cgwin/mgwin does 
for their keywords.
Comment 4 Martin Sebor 2017-01-12 22:54:10 UTC
It's been nearly 13 years with no activity on this request.  I think it's safe to close it as Won't Fix (or at a minimum, lower the Importance).  Please feel free to reopen it if it's still of interest.