Re: Mysterious warning (initialization from distinct Objective-C type)
Re: Mysterious warning (initialization from distinct Objective-C type)
- Subject: Re: Mysterious warning (initialization from distinct Objective-C type)
- From: Cameron Hayne <email@hidden>
- Date: Wed, 21 Sep 2005 09:07:55 -0400
On 21-Sep-05, at 8:42 AM, Cameron Hayne wrote:
On 21-Sep-05, at 7:59 AM, Mason Mark wrote:
Yeah, you may be right about the intent, but I'd consider that a
bug if so. I interpret "allowed" to mean "won't generate a
warning". (And two sentences before noting it is "error-prone" the
same doc states, "A statically typed object can be freely assigned
to an id, or an id to a statically typed object.")
[...]
NSString *myString = [arrayOfStrings objectAtIndex:5];
NSView *view = [_subviews objectAtIndex: viewIndex];
SomeObject *foo = [[SomeObject alloc] init];
[...]
What seems more likely to me is that this is just a GCC bug.
I forgot to ask if you are seeing this warning in *all* of the cases
where an 'id' is assigned to a statically typed variable (e.g. the
ones you illustrate above) or just in some cases?
It might help to track down the bug if you identified which cases it
occurred in. And maybe it would help you towards a way of suppressing
the warning for those cases as well.
--
Cameron Hayne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden