• 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: Mysterious warning (initialization from distinct Objective-C type)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Mysterious warning (initialization from distinct Objective-C type)
      • From: Mason Mark <email@hidden>
References: 
 >Mysterious warning: (From: Dan Wood <email@hidden>)
 >Re: Mysterious warning (initialization from distinct Objective-C type) (From: Mason Mark <email@hidden>)
 >Re: Mysterious warning (initialization from distinct Objective-C type) (From: Cameron Hayne <email@hidden>)
 >Re: Mysterious warning (initialization from distinct Objective-C type) (From: Mason Mark <email@hidden>)
 >Re: Mysterious warning (initialization from distinct Objective-C type) (From: Cameron Hayne <email@hidden>)

  • Prev by Date: Re: Display RTF & RTFD file in NSTextView
  • Next by Date: Re: NSRoundRectBezelStyle still doesn't work with NSPopUpButton?
  • Previous by thread: Re: Mysterious warning (initialization from distinct Objective-C type)
  • Next by thread: Re: Mysterious warning (initialization from distinct Objective-C type)
  • Index(es):
    • Date
    • Thread