-qstaticinline (C++ only)

Pragma equivalent

None.

Purpose

Controls whether inline functions are treated as having static or extern linkage.

When -qnostaticinline is in effect, the compiler treats inline functions as extern: only one function body is generated for a function marked with the inline function specifier, regardless of how many definitions of the same function appear in different source files. When -qstaticinline is in effect, the compiler treats inline functions as having static linkage: a separate function body is generated for each definition in a different source file of the same function marked with the inline function specifier.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nostaticinline-.   
>>- -q--+-staticinline---+-------------------------------------><

Defaults

-qnostaticinline

Usage

When -qnostaticinline is in effect, any redundant functions definitions for which no bodies are generated are discarded by default.

Predefined macros

None.

Examples

Using the -qstaticinline option causes function f in the following declaration to be treated as static, even though it is not explicitly declared as such. A separate function body is created for each definition of the function. Note that this can lead to a substantial increase in code size.
inline void f() {/*...*/};


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