5.71 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++.

Related concepts
5.63 New language features of C99
5.65 // comments in C99 and C90
5.66 Compound literals in C99
5.67 Designated initializers in C99
5.68 Hexadecimal floating-point numbers in C99
5.69 Flexible array members in C99
5.70 __func__ predefined identifier in C99
5.72 long long data type in C99 and C90
5.73 Macros with a variable number of arguments in C99
5.74 Mixed declarations and statements in C99
5.75 New block scopes for selection and iteration statements in C99
5.76 _Pragma preprocessing operator in C99
5.77 Restricted pointers in C99
5.79 Complex numbers in C99
5.20 Inline functions
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.