• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CFBundleGetFunctionPointerForName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFBundleGetFunctionPointerForName


  • Subject: Re: CFBundleGetFunctionPointerForName
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 13 Mar 2008 11:57:06 -0700


On Mar 13, 2008, at 11:43 AM, Alastair Houghton wrote:

On 13 Mar 2008, at 18:32, Steve Checkoway wrote:

On Mar 13, 2008, at 9:09 AM, Sherm Pendley wrote:

In my experience, CFBundleGetFunctionPointerForName wants symbols to be
prefixed with an underscore - that is, _model_call. They're stored that way
in the binary (it's a C thing) and the function doesn't appear to add it for
you before searching.

I'm pretty sure it is not a C thing and that nothing is mentioned in the standard.

Linux, for example, does not prefix its symbols with underscores. I'm pretty sure it's just Mac thing.

IIRC it's an assembler thing.  It happens because the native assemblers on some systems don't require any prefix when talking about registers, which would interfere with C symbols with similar names (e.g. you couldn't have a global called "d0" on some 68K platforms without the '_' prefixes).

A *lot* of platforms use the '_' prefix convention for this reason.  OTOH I don't recall whether Linux is one of them; some platforms hide the '_' prefixes from their dynamic linker APIs.

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

[32.6] How can I create a C++ function f(int,char,float) that is callable by my C code?

The C and C++ standards are silent on these issues, but the underscore conventions are industrywide.

Chris
 _______________________________________________
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

  • Follow-Ups:
    • Re: CFBundleGetFunctionPointerForName
      • From: Steve Checkoway <email@hidden>
    • Leading underscores (was Re: CFBundleGetFunctionPointerForName)
      • From: Peter O'Gorman <email@hidden>
    • Re: CFBundleGetFunctionPointerForName
      • From: Nava Carmon <email@hidden>
References: 
 >CFBundleGetFunctionPointerForName (From: Nava Carmon <email@hidden>)
 >Re: CFBundleGetFunctionPointerForName (From: "Sherm Pendley" <email@hidden>)
 >Re: CFBundleGetFunctionPointerForName (From: Steve Checkoway <email@hidden>)
 >Re: CFBundleGetFunctionPointerForName (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: CFBundleGetFunctionPointerForName
  • Next by Date: Re: Weird stuff
  • Previous by thread: Re: CFBundleGetFunctionPointerForName
  • Next by thread: Re: CFBundleGetFunctionPointerForName
  • Index(es):
    • Date
    • Thread