Re: Is extern inline -> static inline OK?

From: Tim Bird
Date: Fri Aug 06 2004 - 17:26:34 EST


H. Peter Anvin wrote:
Followup to: <4112D32B.4060900@xxxxxxxxxxx>
By author: Tim Bird <tim.bird@xxxxxxxxxxx>
In newsgroup: linux.dev.kernel

Pardon my ignorance...

Under what conditions is it NOT OK to convert "extern inline"
to "static inline"?



When the code is broken if it doesn't inline.

Thanks!

From what I have read, for either 'extern inline' or 'static inline'
the compiler is free to not inline the code. Is this wrong?

It is my understanding that...
In the 'static inline' case the compiler may create a function in the
local compilation unit. But in the 'extern inline' case an extern
non-inline function must exist. If the compiler decides not to inline
the function, and a non-inline function does not exist, you get a linker
error. Are you saying that, therefore, 'extern inline' functions are
used (without definition of extern non-inline functions to back them)
in order to guarantee that NO non-inline version of the function exists?

Or are you saying that the non-inline version of the function may
be written differently than the inline version?

Sorry to be so dense... I really appreciate your help.

=============================
Tim Bird
Architecture Group Co-Chair, CE Linux Forum
Senior Staff Engineer, Sony Electronics
E-mail: tim.bird@xxxxxxxxxxx
=============================
-
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/