To clarify, I meant that C standard requires that the
out-of-line copy of an INLINE FUNCTION must not be generated
in that translation unit.
Which is simply wrong. Neither the C nor the C++ standard ever
make any requirements with regards to what is or is not
generated. The requirements only concern the behavior of the
compiled code.
And its linkage is external. A call to that inline function, if not
inlined, must be satisfied by an external definition of that inline
function in another translation unit.
Again, that's not what the C standard says. The C standard says
that there must be a non-inline definition of the function
somewhere, and that it is unspecified whether you get the
non-inline definition (possibly in another translation unit) or
the inline definition (immediately visible). Except for
requiring the non-inline definition, and making the behavior
unspecified (rather than undefined), this is not so radically
different from the C++ standard. Basically: if a function is
inline, it can (and doubtlessly will) be defined in many
different places in the program. In C++, if the definitions are
not identical, the behavior is undefined. In C, it is
unspecified which definition you actually get.
Unfortunately, that is not wrong. Whether this requirement in C
is good or not is another issue. If you have C standard (C99),
you can check its definition of inline function (C defines inline
function in its own way).
I did that immediately before posting, thank you. The C
standard, like the C++ standard, never says the slightest thing
about what the compiler generates. All it specifies is the
behavior of the program. In particular, we find: "The function
specifier may appear more than once; the behavior is the same as
if it appeared only once. Making a function an inline function
suggests that calls to the function be as fast as possible. The
extent to which such suggestions are effective is
implementation-defined."
Clearly, whether the compiler lays out an out of line copy or
not is up to the compiler. (And I rather suspect that the
"implementation-defined", rather than "unspecified", is a
defect. I don't really expect a compiler to document its
choices here, as they doubtlessly depend on optimization and
debug options.)