• 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: Weak linking failing on Intel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weak linking failing on Intel?


  • Subject: Re: Weak linking failing on Intel?
  • From: Rosyna <email@hidden>
  • Date: Sat, 6 May 2006 12:18:51 -0700

Err, forgot something important.

Specifically, I'm using the instructions for weak linking a framework at http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html#//apple_ref/doc/uid/20002378-107026

Since I don't own this particular framework, I'd have to redeclare every single function I use in a brand new header with the weak attribute. For somethings I use, this is 20+ symbols.

Ack, at 5/6/06, Alexei Kosut said:

Why is it completely skipping the if check? As I said, this exact same code works fine on a PPC mac. If it matters, the PPC code is being compiled with GCC 3.3.

Yes, it matters. GCC 3.3 would let you check any symbol against NULL, but GCC 4.0 knows that the function has not been weak linked, so optimizes away your check for NULL. If a symbol is to be weak-linked, you should ensure it is declared with __attribute__((weak_import)). This tells the compiler that a check against NULL could be true.

--


Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
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


References: 
 >Weak linking failing on Intel? (From: Rosyna <email@hidden>)
 >Re: Weak linking failing on Intel? (From: Alexei Kosut <email@hidden>)

  • Prev by Date: Re: Weak linking failing on Intel?
  • Next by Date: Re: text editor - shift left/right
  • Previous by thread: Re: Weak linking failing on Intel?
  • Next by thread: Re: Weak linking failing on Intel?
  • Index(es):
    • Date
    • Thread