This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12401] G++ generates boguous weak definition of library routine
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Dec 2003 04:10:14 -0000
- Subject: [Bug c++/12401] G++ generates boguous weak definition of library routine
- References: <20030925121817.12401.uddeborg@carmen.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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