Ob

Specifies the level of inline function expansion.

IDE Equivalent

Windows: C/C++ > General > Inline Function Expansion

Linux: Optimization > Inline Function Expansion

Mac OS: Optimization > Inline Function Expansion Only INLINE directive

Architectures

IA-32, IntelŪ EM64T, IntelŪ ItaniumŪ architecture

Syntax

Linux and Mac OS: -Obn
Windows:  /Obn

Arguments

n    Is the inline function expansion level. Possible values are 0, 1, and 2.

Default

Ob2 If option O2 is specified or is in effect by default.
Ob0 If option -O0 (Linux and Mac OS) or /Od (Windows) is specified

Description

This option specifies the level of inline function expansion. Inlining procedures can greatly improve the run-time performance of certain programs.

Option Description
Ob0 Disables inlining of user-defined functions. Note that statement functions are always inlined.
Ob1 Enables inlining when an inline keyword or an inline attribute is specified. Also enables inlining according to the C++ language.
Ob2 Enables inlining of any function at the compiler's discretion.

Alternate Options

None