Ok, according to my gcc man page ...
The compiler uses many heuristics to determine whether to embed a function. For example, the compiler takes into account the size of the built-in function and the amount of insertion that has already been done in the current function. Therefore, it would seem that minor changes in the source program may cause warnings created by -Winline to appear or disappear.
I do not believe that you can force the compiler to inline your function; this is an implementation detail that may even change when the compiler is updated. Also, as long as choosing a compiler makes your function run faster, is there any special reason that bothers you if the function is really enabled or not?
Of course, if you really want to inline your function for some reason, you can probably use a macro for this.
source share