> > We ran into a problem building KDE on HP-UX 11.23/IA with the HP C++ > compiler. The compiler mangled a function name in a .cpp file though > it was declared extern "C" in the .h file. After a post to the HP C++ > developers list, we were told this behavior is correct. GCC 4.0.2 does > not do this so I'd like to get your opinion. > > $ cat mangle-1.cc > typedef enum { > XSLDBG_MSG_THREAD_NOTUSED, > XSLDBG_MSG_THREAD_INIT > } XsldbgMessageEnum; > > extern "C" { > void xsldbgSetAppFunc (int (*notifyXsldbgAppFunc) (XsldbgMessageEnum type, > const void *data)); > } > > static int (*notifyXsldbgAppFuncPtr) (XsldbgMessageEnum type, > const void *data) = 0; > > void xsldbgSetAppFunc (int (*notifyXsldbgAppFunc) (XsldbgMessageEnum type, > const void *data)) > { > notifyXsldbgAppFuncPtr = notifyXsldbgAppFunc; > }
This is most likely very related to PR 2316 where GCC does not use language as the overloaded part. -- Pinski