On Feb 22, 2008, at 13:11, Greg Troxel wrote:
[EMAIL PROTECTED] (Ludovic Courtès) writes:
Currently, we assume that only GCC knows how to handle "extern
inline".
I'm not sure this assumption is true in practice (doesn't C99 specify
it?), but it's probably "good enough".
That seems ok - I'm not 100% clear on what's in the standards here,
particularly about declarations and inline definitions.
Unfortunately, when C99 specified it, about 10 years after GCC
implemented it, the specification was different from GCC's
implementation -- pretty close to reversing "inline" and "extern
inline". And I think GCC's implementation is being updated to
conform to the standard, but there's still the older versions and the
transition period to deal with. Inline specifiers aside, you can't
follow up a declaration with external linkage with another
declaration with internal linkage, and I don't think the specs on
"inline" change that.
What's the desired effect? Expand inline if possible, and provide an
external definition for non-inline-expanded calls to reference? I
think under C99 you want just plain "inline" for the inline
definition, and then in one of the source files, add an "extern"
declaration; that pretty much matches the example in the C99 spec.
Ken