How to force gcc to inline a function

compiler-flagsgccinline()

Does __attribute__((always_inline)) force a function to be inlined by gcc?

Best Answer

Yes.

always_inline

Generally, functions are not inlined unless optimization is specified. For functions declared inline, this attribute inlines the function even if no optimization level was specified.