Re: How does the compiler figure out conflicting return types, and why no warnings?
Re: How does the compiler figure out conflicting return types, and why no warnings?
- Subject: Re: How does the compiler figure out conflicting return types, and why no warnings?
- From: "Jonathan del Strother" <email@hidden>
- Date: Wed, 12 Dec 2007 13:08:22 +0000
On Dec 12, 2007 1:02 PM, Alastair Houghton <email@hidden> wrote:
> On 12 Dec 2007, at 12:43, Jonathan del Strother wrote:
>
> > I get no warnings no matter what warning switches I turn on, yet the
> > code fails miserably at runtime : the compiler is expecting
> > [disclosure rotation] to return a float (presumably from the -[NSEvent
> > rotation] message), so we get garbage data in the return value.
> >
> > Obviously there's no way for the compiler to really know what to do
> > here, since 'disclosure' is of type id, and there's at least two
> > methods called 'rotation' with differing return types. But shouldn't
> > we at least get a warning?
>
> I'm sure they've added a warning for this in Xcode 3. Which version
> of Xcode/GCC are you using?
Xcode 3.0, with gcc 4.0.1. I get no warnings on a brand new project
with default build settings.
Thanks for the other suggestions.
_______________________________________________
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