Re: [discuss] [2.6 patch] include/asm-x86_64 "extern inline" -> "static inline"

Andi Kleen
2005-09-06T20:23:58Z

I don't think the functionality of having single copies in case
an out of line version was needed was ever required by the Linux kernel.

extern inline was used in the kernel a long time ago as a "poor man's
-Winline". Basically the intention was to get an linker error
if the inlining didn't work for some reason because if we say
inline we mean inline.

But that's long obsolete because the requirements of the C++ "template is
turing complete" people has broken inlining so badly (they want a lot of
inlining, but not too much inlining because otherwise their compile times
explode and the heuristics needed for making some of these pathologic cases
work seems to break a lot of other sane code) that the kernel was forced to
define inline to __attribute__((always_inline)). And with that you get an
error if inlining
fails.

So the original purpose if extern inline is fulfilled by static inline now.
However extern inline also doesn't hurt, it really makes no difference now.

-Andi