Developer Guide and Reference

Contents

fvisibility

Specifies the default visibility for global symbols or the visibility for symbols in a file.

Syntax

Linux and macOS:
-fvisibility
=
keyword
-fvisibility-
keyword
=
filename
Windows:
None
Arguments
keyword
Specifies the visibility setting. Possible values are:
default
Sets visibility to default.
extern
Sets visibility to extern.
hidden
Sets visibility to hidden.
internal
Sets visibility to internal.
protected
Sets visibility to protected. This value is not available on
macOS*
systems.
filename
Is the pathname of a file containing the list of symbols whose visibility you want to set. The symbols must be separated by whitespace (spaces, tabs, or newlines).
Default
-fvisibility=default
The compiler sets visibility of symbols to default.
Description
This option specifies the default visibility for global symbols (syntax
-fvisibility=
keyword
) or the visibility for symbols in a file (syntax
-fvisibility-
keyword=filename
).
Visibility specified by
-fvisibility-
keyword=filename
overrides visibility specified by
-fvisibility=
keyword
for symbols specified in a file.
Option
Description
-fvisibility=default
-fvisibility-default
=filename
Sets visibility of symbols to default. This means other components can reference the symbol, and the symbol definition can be overridden (preempted) by a definition of the same name in another component.
-fvisibility=extern
-fvisibility-extern
=filename
Sets visibility of symbols to extern. This means the symbol is treated as though it is defined in another component. It also means that the symbol can be overridden by a definition of the same name in another component.
-fvisibility=hidden
-fvisibility-hidden
=filename
Sets visibility of symbols to hidden. This means that other components cannot directly reference the symbol. However, its address may be passed to other components indirectly.
-fvisibility=internal
-fvisibility-internal
=filename
Sets visibility of symbols to internal. This means that the symbol cannot be referenced outside its defining component, either directly or indirectly. The affected functions can never be called from another module, including through function pointers.
-fvisibility=protected
-fvisibility-protected
=filename
Sets visibility of symbols to protected. This means other components can reference the symbol, but it cannot be overridden by a definition of the same name in another component. This value is not available on
macOS*
systems.
If an
-fvisibility
option is specified more than once on the command line, the last specification takes precedence over any others.
If a symbol appears in more than one visibility
filename
, the setting with the least visibility takes precedence.
The following shows the precedence of the visibility settings (from greatest to least visibility):
  • extern
  • default
  • protected
  • hidden
  • internal
Note that
extern
visibility only applies to functions. If a variable symbol is specified as
extern
, it is assumed to be
default
.
Alternate Options
None
A file named
prot.txt
contains symbols a, b, c, d, and e. Consider the following:
-fvisibility-protected=prot.txt
This option sets
protected
visibility for all the symbols in the file. It has the same effect as specifying
fvisibility=protected
in the declaration for each of the symbols.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804