Compile the following test case:
extern "C" {
typedef unsigned long size_t;
int snprintf(char * , size_t, const char * , ...) __asm("_fancy_snprintf");
}
namespace std { using ::snprintf; }
namespace std { void foo() { snprintf(0, 3, ""); } }
If you examine the assembly file or the .o file, you will see that we're
invoking _snprintf. This is wrong.
We should be invoking _fancy_snprintf.
Note that it's important that we're importing into namespace std. If I change
the name to something
else, the problem goes away.
--
Summary: Alternate "asm" name ignored for function imported into
namespace std
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: austern at apple dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin7.6.0
GCC host triplet: powerpc-apple-darwin7.6.0
GCC target triplet: powerpc-apple-darwin7.6.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18514