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: Mason Mark <email@hidden>
- Date: Wed, 21 Sep 2005 22:26:12 +0900
On Sep 21, 2005, at 10:07 PM, Cameron Hayne wrote:
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.
No, not even close to all of them; in a project of about 100,000
lines of code, that was the only one. But, now that you mention it,
I've noticed one more:
NSDecimalNumber *now = [NSDecimalNumber numberWithDouble:[NSDate
timeIntervalSinceReferenceDate]];
As possible, I will keep investigating and file a bug report when I
have a coherent one...
Cheers,
--
Mason Mark
Five Speed Software, Inc.
_______________________________________________
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