From: Arnaud Giersch Date: Thu, 16 Jan 2020 08:35:40 +0000 (+0100) Subject: Using extern "C" does not prevent name mangling for static functions. X-Git-Tag: v3.25~107 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4d4d8d75f6ffcfcee6eeaa328499321e3249ef07 Using extern "C" does not prevent name mangling for static functions. See https://en.cppreference.com/w/cpp/language/language_linkage --- diff --git a/src/kernel/context/ContextUnix.cpp b/src/kernel/context/ContextUnix.cpp index c074806302..264b603318 100644 --- a/src/kernel/context/ContextUnix.cpp +++ b/src/kernel/context/ContextUnix.cpp @@ -25,12 +25,12 @@ static_assert(sizeof(simgrid::kernel::context::UContext*) <= CTX_ADDR_LEN * size /* Make sure that this symbol is easy to recognize by name, even on exotic platforms */ extern "C" { -XBT_ATTRIB_NORETURN static void smx_ctx_wrapper(int i1, int i2); +XBT_ATTRIB_NORETURN void smx_ctx_wrapper(int i1, int i2); } // The name of this function is currently hardcoded in MC (as string). // Do not change it without fixing those references as well. -static void smx_ctx_wrapper(int i1, int i2) +void smx_ctx_wrapper(int i1, int i2) { // Rebuild the Context* pointer from the integers: int ctx_addr[CTX_ADDR_LEN] = {i1, i2};