I have a file funcs.h where I have the declaration of function:
inline void some_func( void ) __attribute__((always_inline)); Then I have a file funcs.c where I have the implementation of the function:
inline void some_func( void ) { … } Then in my main file main.c I #include the funcs.h and try to use some_func() somewhere in the code. However when I compile my program and look at the binary file, the function appears to be compiled as a regular separate function, and called just like any other regular function, instead of being embedded as inline.
Why is that happening, and is there a way to force actual inlining into this? (Except the option of just using #define macros instead of functions, of course.)
-fltoswitch).a+bfunction isn't inlined with gcc 4.8 and-flto. Moreover, using this attribute produces compile error, since compiler knows for sure that it can't inline, while programmer insists that it should.