• 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: int* array going astray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: int* array going astray


  • Subject: Re: int* array going astray
  • From: Graham Cox <email@hidden>
  • Date: Wed, 25 Nov 2009 15:56:29 +1100

On 25/11/2009, at 3:35 PM, James Maxwell wrote:

> (funny that I didn't get a warning, actually... Is there any build setting that will protect me from a similar bought of blindness in the future?)


The warning you want is 'possible unwanted assignment', and I think it comes with the -Wall flag. Note though that the very widely used construction:

	while( object = [myEnumerator nextObject]){...}

will throw this warning which may require quite a bit of code revision to:

	while(( object = [myEnumerator nextObject])){...}

so I also recommend getting into the habit of using the double-bracket notation automatically, or use modern fast enumeration.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: int* array going astray
      • From: Jens Alfke <email@hidden>
References: 
 >int* array going astray (From: James Maxwell <email@hidden>)
 >Re: int* array going astray (From: Michael Babin <email@hidden>)
 >Re: int* array going astray (From: James Maxwell <email@hidden>)
 >Re: int* array going astray (From: James Maxwell <email@hidden>)

  • Prev by Date: Re: int* array going astray
  • Next by Date: Re: IKImageBrowserView selection notification
  • Previous by thread: Re: int* array going astray
  • Next by thread: Re: int* array going astray
  • Index(es):
    • Date
    • Thread