• 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: narrowing down where "non-relocatable subtraction expression" errors come from?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: narrowing down where "non-relocatable subtraction expression" errors come from?


  • Subject: Re: narrowing down where "non-relocatable subtraction expression" errors come from?
  • From: Chris Suter <email@hidden>
  • Date: Wed, 18 Aug 2010 07:13:58 +1000

Hi Michael,

On Wed, Aug 18, 2010 at 5:35 AM, Michael Dautermann <email@hidden> wrote:

Thanks for responding, Chris...  I had never noticed that "Show Assembly Code" menu item under the Build menu before.  The assembly that was produced didn't have any obvious way to connect back to the lines of code that generated the assembly,

You should be able to see “.loc” directives which indicate line numbers. If you’re not getting those, check you’ve got the correct debugging settings.
 
but I was able to look at the symbols being CALLed & .GLOBL declared  to get a general idea of where my problem was happening.  I eventually discovered that this all came down to a call to lrint (which was being passed a CGFloat value instead of a double) which I fixed by changing it to lrintf.

Bear in mind that CGFloat is a double in some circumstances (e.g. on x86_64). There’s a macro you can use to check if that’s the case: CGFLOAT_IS_DOUBLE.

I wonder if the original error (the "non-relocatable subtraction _expression_" output) should be filed in Radar?

Yes, definitely. I’m not sure whether the bug is in the linker or in the compiler. You might experiment to see if you see the same bug with different compilers. Also the Xcode 4 preview might come with a new linker so you could give that a try if you have access to it.

Kind regards,

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

References: 
 >narrowing down where "non-relocatable subtraction expression" errors come from? (From: Michael Dautermann <email@hidden>)
 >Re: narrowing down where "non-relocatable subtraction expression" errors come from? (From: Chris Suter <email@hidden>)
 >Re: narrowing down where "non-relocatable subtraction expression" errors come from? (From: Michael Dautermann <email@hidden>)

  • Prev by Date: Re: narrowing down where "non-relocatable subtraction expression" errors come from?
  • Next by Date: c++ constructor arguments
  • Previous by thread: Re: narrowing down where "non-relocatable subtraction expression" errors come from?
  • Next by thread: formatting issue in gdb
  • Index(es):
    • Date
    • Thread