• 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: John McCall <email@hidden>
  • Date: Tue, 13 Oct 2015 15:56:46 -0700

> On Oct 13, 2015, at 3:24 PM, Graham Cox <email@hidden> wrote:
> In a piece of code I haven’t worked on in a while, I’m suddenly getting a new warning which I’ve never seen before:
>
> “Multiple unsequenced modifications to ‘ix’”
>
> Code is:
>
>
> ix = ++ix % guess.count;
>
> where ix is a NSUInteger.
>
> Is this telling me that the order of the preincrement and the mod operation is undefined? Surely a preincrement is defined to happen first, that’s why it’s called a PREincrement? Or does the warning refer to something else? I’ve used this form of expression for years without any issues, why is it suddenly one?

Pre-increment is defined to return the value that would be stored in its operand.  The actual store to the operand is indeterminately sequenced with returning that value, however.

John.



_______________________________________________

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>)

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