This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: kernel-2.2.1-undefined references.


Linus writes, in response to a suggestion to use a special feature of
macros:

> Why don't you just remove "inline" completely, then?
> 
> It's apparently ok to break documented and existing behaviour of "inline". 
> Go read the gcc documentation about "extern inline", the whole thing is
> _designed_ to be a much more readable form of #define. 

Hmm.  Linus does seem to have a point here.  See the node "Inline"
in the gcc manual.

"   If you specify both `inline' and `extern' in the function
 definition, then the definition is used only for inlining.  In no case
 is the function 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."

This seems to be a fairly strong promise that the function is guaranteed
to be either inline or to come out undefined (unless there is a second
non-extern-inline definition).

Many people have been answering based on general compiler principles
rather than by looking at the promises made in the gcc documentation for
an *extension*.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]