Skip to main content

IAR Embedded Workbench for Arm 9.70.x

inline

In this section:
Syntax
#pragma inline[=forced|=never|=no_body|=forced_no_body]
Parameters

No parameter

Has the same effect as the inline keyword.

forced

Disables the compiler’s heuristics and forces inlining.

never

Disables the compiler’s heuristics and makes sure that the function will not be inlined.

no_body

Has the same effect as the inline keyword, but the generated function will not have a body.

forced_no_body

Disables the compiler’s heuristics and forces inlining. The generated function will not have a body.

Description

Use #pragma inline to advise the compiler that the function defined immediately after the directive should be inlined according to C++ inline semantics.

Specifying #pragma inline=forced or #pragma inline=forced_no_body will always inline the defined function. If the compiler fails to inline the function for some reason, for example due to recursion, a warning message is emitted.

Inlining is normally performed only on the High optimization level. Specifying #pragma inline=forced or #pragma inline=forced_no_body will inline the function on all optimization levels or result in an error due to recursion, etc.

See also

Inlining functions.