FROM : Graham Cox
DATE : Sun Jun 08 14:29:25 2008
No, this is not it. The method definitely did have a prototype - in
fact it had *two*, differing only in return type. Judging by the
assembler code, it used the one returning an int (actually an enum)
not a float. It's still unclear why this generated code that trashed
memory, but it did. It also did silently cast the result as well,
which is perhaps why no warning was issued, because in some cases
that's the desired behaviour.
G.
On 7 Jun 2008, at 1:50 am, Michael Vannorsdel wrote:
> I suspect since the method had no prototype the compiler just
> assumed the default id return type, but due to a bug didn't generate
> a warning. The problem is most likely the calling method was
> expecting the return value to be an integer (id; pointer) but
> instead is a float. Even with a cast being assumed the calling
> method is still having a floating point register trashed by
> believing it was safe.
DATE : Sun Jun 08 14:29:25 2008
No, this is not it. The method definitely did have a prototype - in
fact it had *two*, differing only in return type. Judging by the
assembler code, it used the one returning an int (actually an enum)
not a float. It's still unclear why this generated code that trashed
memory, but it did. It also did silently cast the result as well,
which is perhaps why no warning was issued, because in some cases
that's the desired behaviour.
G.
On 7 Jun 2008, at 1:50 am, Michael Vannorsdel wrote:
> I suspect since the method had no prototype the compiler just
> assumed the default id return type, but due to a bug didn't generate
> a warning. The problem is most likely the calling method was
> expecting the return value to be an integer (id; pointer) but
> instead is a float. Even with a cast being assumed the calling
> method is still having a floating point register trashed by
> believing it was safe.






Cocoa mail archive

