This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Name mangling issue with HP, Sun, Tru64 UNIX C++ but not GCC
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 1 Feb 2006 13:21:03 -0500 (EST)
- Subject: Re: Name mangling issue with HP, Sun, Tru64 UNIX C++ but not GCC
>
> 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