Sun Studio 12: C User's Guide

2.8.11 inline

#pragma [no_]inline (funcname[, funcname])

This pragma controls the inlining of routine names listed in the argument of the pragma. The scope of this pragma is over the entire file. Only global inlining control is allowed, call-site specific control is not permitted by this pragma.

If you use #pragma inline, it provides a suggestion to the compiler to inline the calls in the current file that match the list of routines listed in the pragma. This suggestion may be ignored under certain cases. For example, the suggestion is ignored when the body of the function is in a different module and the crossfile option is not used.

If you use #pragma no_inline, it provides a suggestion to the compiler to not inline the calls in the current file that match the list of routines listed in the pragma.

Both #pragma inline and #pragma no_inline are permitted only after the function is declared with a prototype or empty parameter list as the following example shows:


static void foo(int);
static int bar(int, char *);
#pragma inline(foo, bar)

See also -xldscope, -xinline, -xO, and -xcrossfile.