Inline expansion of function (#pragma inline, #pragma noinline)


This notifies the compiler of an inline function.

[Function]

-

#pragma inline declares a function to be expanded inline.

-

#pragma noinline declares a function whose inline expansion is to be stopped when the -Oinline_level option is used.

-

If both #pragma inline and #pragma noinline are specified for the same function within a single translation unit, an error will occur.

-

The #pragma inline directive should be written before the definition of the target function within the translation unit that includes the function definition.

-

#pragma inline has the same function as keyword __inline. For details of inline expansion, see "Specifying inline function (__inline)".

[Usage]

-

#pragma inline and #pragma noinline are declared before the target functions.

#pragma inline      [(]function-name [,...][)]
#pragma noinline    [(]function-name [,...][)]

[Example]

extern int      gi;
 
#pragma inline  i_func
 
static int i_func(int i)
{
        return ++i;
}
 
void func(int j)
{
        gi = i_func(j);
}