visibility

The visibility function attributes describe whether and how a function defined in one module can be referenced or used in other modules. By using this feature, you can make a shared library smaller and decrease the possibility of symbol collision. For details, see Using visibility attributes.

Read syntax diagramSkip visual syntax diagram
visibility function attribute syntax

>>-__attribute__------------------------------------------------>

>--((--+-visibility-----+--(--+-"default"---+--)--))-----------><
       '-__visibility__-'     +-"protected"-+          
                              +-"hidden"----+          
                              '-"internal"--'          

Example

In the following example, the visibility attribute of function void f(int i, int j) is hidden:
void __attribute__((visibility("hidden"))) f(int i, int j);


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us