Re: multiple definitions of symbol _xxxx
Re: multiple definitions of symbol _xxxx
- Subject: Re: multiple definitions of symbol _xxxx
- From: Steve Checkoway <email@hidden>
- Date: Fri, 9 Feb 2007 02:26:04 -0800
On Feb 9, 2007, at 1:21 AM, Thomas Engelmeier wrote:
BTW, it is not necessary to use static for C++ inlines in order to
enforce "local" linkage. I am not sure if C99 has inline as keyword
and how it handles it, though.
6.4.1.1 of ISO/IEC 9899:1999 (E) specifies inline as a keyword. 6.7.4
describes the requirements on inline. There are somewhat mysterious
interactions between inline and functions with external linkage that
I don't really care to try to parse:
6.7.4.6 says
Any function with internal linkage can be an inline function. For a
function with external linkage, the following restrictions apply:
If a function is declared with an inline function specifier, then
it shall also be defined in the same translation unit. If all of
the file scope declarations for a function in a translation unit
include the inline function specifier without extern, then the
definition in that translation unit is an inline definition. An
inline definition does not provide an external definition for the
function, and does not forbid an external definition in another
translation unit. An inline definition provides an alternative to
an external definition, which a translator may use to implement any
call to the function in the same translation unit. It is
unspecified whether a call to the function uses the inline
definition or the external definition.
The spec doesn't seem to say anything about inline forcing internal
linkage.
In fact, the word "inline" only appears 21 times in the 550 pages of
the c99 spec. In fact, about the strongest thing it seems to say
about inline is that it "suggests that calls to the function be as
fast as possible." In a footnote, it lists several ways that calls
can be made fast.
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden