• 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: New warning in Xcode 7
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New warning in Xcode 7


  • Subject: Re: New warning in Xcode 7
  • From: Graham Cox <email@hidden>
  • Date: Wed, 14 Oct 2015 10:06:03 +1100

> On 14 Oct 2015, at 9:50 am, Greg Parker <email@hidden> wrote:
>
> You can avoid confusion (human and compiler) by writing the statement without the preincrement's side effect:
>    ix = (ix+1) % guess.count;
>


OK, makes sense.

I think my use of the preincrement followed by mod stems from years-old habits of writing embedded software, where ++<var> would typically compile to a single instruction on the 8051 or similar where every clock cycle counted (and <var>=<var>+1 would not). I guess these days it’s a moot point :)

—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


References: 
 >New warning in Xcode 7 (From: Graham Cox <email@hidden>)
 >Re: New warning in Xcode 7 (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: New warning in Xcode 7
  • Next by Date: Handling http:// URLs
  • Previous by thread: Re: New warning in Xcode 7
  • Next by thread: Re: New warning in Xcode 7
  • Index(es):
    • Date
    • Thread