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

From: Terrence Miller
Date: Tue Sep 06 2005 - 15:56:31 EST


Andi Kleen wrote:
> 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.

But shouldn't the compiler that compiles Linux be C99 compliant?

> 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
>

--

Terrence

****************************************************
| Terrence C. Miller | Sun Microsystems |
| terrence.miller@xxxxxxx | M.S. MPK16-303 |
| 650-786-9192 | 16 Network Circle |
| | Menlo Park, CA 94025 |
****************************************************


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/