• 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: Problem using static floats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using static floats


  • Subject: Re: Problem using static floats
  • From: "Shawn Erickson" <email@hidden>
  • Date: Thu, 19 Jul 2007 10:37:56 -0700

On 7/19/07, Scott F Bayes <email@hidden> wrote:
Hi Joel,

I saw something somewhat similar a few days ago and submitted a bug
report. No response yet. 10.4.10 on an original MacBook, latest
Xcode, stock standard.

In my case, passing a float into an Obj-C instance method failed.
Just before the method call, the debugger showed the expected value
in my float variable. On the other side, inside the method, the
incoming float argument was essentially a random number. When I
changed to a double, it worked fine. So did an int.

This sounds like the caller assuming the return type to be something other then what the implementation expected. Did you get any compiler warnings about it assuming the return type for a message?

It is highly likely that the calling code doesn't have visibility of
the methods declaration and as a result assumes the return type to be
id (a pointer) which is default return type for objective-c messages.
Pointers (integers) are passed in different registers the floats and
as a result the caller is looking in the wrong registers on return
from the method.

-Shawn
_______________________________________________
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: Problem using static floats
      • From: Scott F Bayes <email@hidden>
    • Re: Problem using static floats
      • From: "Shawn Erickson" <email@hidden>
References: 
 >Problem using static floats (From: Joel Norvell <email@hidden>)
 >Re: Problem using static floats (From: Scott F Bayes <email@hidden>)

  • Prev by Date: Re: Problem using static floats
  • Next by Date: Re: Problem using static floats
  • Previous by thread: Re: Problem using static floats
  • Next by thread: Re: Problem using static floats
  • Index(es):
    • Date
    • Thread