This is the mail archive of the
mailing list for the GCC project.
Re: inline functions not getting internal linkage in x86 without optimization
- To: marc_auslander at us dot ibm dot com
- Subject: Re: inline functions not getting internal linkage in x86 without optimization
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Fri, 26 Jun 1998 22:06:00 +0200
- CC: egcs-bugs at cygnus dot com
- References: <8525662E.006C9CEB.email@example.com>
> C++ specifies that inline implies internal linkage.
Could you provide some support for this claim? In [basic.link], I see
the definition for internal linkage:
>> A name having namespace scope (3.3.5) has internal linkage if it is
>> the name of
>> - an object, reference, function or function template that is
>> explicitly declared static or,
>> - an object or reference that is explicitly declared const and
>> neither explicitly declared extern nor previously declared to have
>> external linkage; or
>> - a data member of an anonymous union.
Neither applies, so the function has not internal linkage. So the next
>> A name having namespace scope has external linkage if it is the
>> name of
>> - a function, unless it has internal linkage; or
bar is a function that does not have internal linkage, so it has
Your program violates one definition rule, specifically
>> There can be more than one definition of a class type (clause 9),
>> enumeration type (7.2), inline function with external linkage
>> (7.1.2), ... Given such an entity named D defined in more than one
>> translation unit, then ... each definition of D shall consist of
>> the same sequence of tokens; ...
Your PwrPC compiler is still correct:
>> ... If the definitions of D do not satisfy these requirements, then
>> the behavior is undefined.
Hope this helps,