5.67 inline functions in C99

The C99 keyword inline hints to the compiler that invocations of a function qualified with inline are to be expanded inline.

For example:

inline int max(int a, int b)
{
    return (a > b) ? a : b;    
}

The compiler inlines a function qualified with inline only if it is reasonable to do so. It is free to ignore the hint if inlining the function adversely affects performance.

Note:

The __inline keyword is available in C90.

Note:

The semantics of inline in C99 are different to the semantics of inline in Standard C++.

Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.