Leading underscores (was Re: CFBundleGetFunctionPointerForName)
Leading underscores (was Re: CFBundleGetFunctionPointerForName)
- Subject: Leading underscores (was Re: CFBundleGetFunctionPointerForName)
- From: Peter O'Gorman <email@hidden>
- Date: Thu, 13 Mar 2008 18:28:56 -0500
Chris Espinosa wrote:
>
> The leading underscore is C name mangling, as opposed to C++ name
> mangling that uses leading double underscores. It allows the compiler to
> distinguish user
>
> Name mangling - Wikipedia, the free encyclopedia
> <http://en.wikipedia.org/wiki/Name_mangling#C_name_decoration_in_Microsoft_Windows>
>
> [32.6] How can I create a C++ function f(int,char,float) that is
> callable by my C code?
> <http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.6>
>
> The C and C++ standards are silent on these issues, but the underscore
> conventions are industrywide.
Many platforms do indeed use a leading underscore for C symbols,
however, there are a lot of platforms that do not. AIX, HP-UX, IRIX,
Solaris, and most Linux platforms do not add a leading underscore to C
symbols (blackfin Linux, at least, adds the underscore).
Because of so many unix platforms not adding a leading underscore to C
symbols the dlsym(3) interface on Mac OS X does not require a leading
underscore on the symbol name, while all the other dyld symbol lookup
api require the leading underscore.
It's all very messy.
Peter
--
Peter O'Gorman
http://pogma.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden