__attribute__((always_inline)) function attribute

This function attribute indicates that a function must be inlined.

The compiler attempts to inline the function, regardless of the characteristics of the function. However, the compiler does not inline a function if doing so causes problems. For example, a recursive function is inlined into itself only once.

Note

This function attribute is a GNU compiler extension that the ARM compiler supports. It has the keyword equivalent __forceinline.

Show/hideExample

static int max(int x, int y) __attribute__((always_inline));
static int max(int x, int y)
{
    return x > y ? x : y; // always inline if possible
}

Show/hideSee also

Copyright © 2010-2012 ARM. All rights reserved.ARM DUI 0491H
Non-ConfidentialID070912