Re: [PATCH 1/6] UML - Fix inlines

From: Adrian Bunk
Date: Mon Aug 20 2007 - 15:56:22 EST


On Mon, Aug 20, 2007 at 12:40:30PM -0700, Andrew Morton wrote:
> On Fri, 17 Aug 2007 15:43:40 -0400
> Jeff Dike <jdike@xxxxxxxxxxx> wrote:
>
> > "extern inline" will have different semantics with gcc 4.3.
>
> What are these different semantics?

With gcc <= 4.2, when using "extern inline" in no case the function is
compiled on its own, not even if you refer to its address explicitly.
Such an address becomes an external reference, as if you had only
declared the function, and had not defined it.

In C99 (and therefore in gcc >= 4.3), "extern inline" means that the
function should be compiled inline where the inline definition is seen,
and that the compiler should also emit a copy of the function body with
an externally visible symbol.

Except for the Alpha port all users in the kernel used "extern inline"
only for getting "static inline" semantics (older gcc versions didn't
offer the always_inline function attribute).

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

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