Inline functions
suggest changeC99 introduced the inline function specifier. It gives the implementation permission to optimize calls using an inline definition, but it does not require call-site expansion. Conversely, a compiler can inline a function that has no inline specifier.
static inline int minimum(int left, int right)
{
return left < right ? left : right;
}
static inline is the simplest form for small helper functions defined in a header: each translation unit receives its own internal-linkage definition.
Plain inline and extern inline have linkage rules that differ from C++ and from some historical compiler modes. A function with external linkage may still require one external definition in exactly one translation unit. See Inlining functions used in more than one source file before placing an externally linked inline function in a header.
Choose inline for linkage and definition semantics, not as a promise of performance. Measure optimized builds if call overhead or code size matters.