This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/12401] G++ generates boguous weak definition of library routine


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-25 04:10 -------
Acutally "extern inline" in C++ is difference that GCC's c extesion "extern inline", "extern inline" in 
C++ means that the function is extern but is declared in all translation unit as inline.

>From the C++ standard:
7.1.2 Function specifiers
4 An inline function shall be defined in every translation unit in which it is used and shall have 
exactly the same definition in every case (3.2). [Note:a call to the inline function may be 
encountered before its definition appears in the translation unit. ] If a function with external 
linkage is declared inline in one translation unit, it shall be declared inline in all translation units in 
which it appears; no diagnostic is required. An inlinefunction with external linkage shall have the 
same address in all translation units. Astatic local variable in anextern inlinefunction always refers 
to the same object. A string literal in an extern inlinefunction is the same object in different 
translation units. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12401


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