• 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: strange "warning: operation on '...' may be undefined"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange "warning: operation on '...' may be undefined"


  • Subject: Re: strange "warning: operation on '...' may be undefined"
  • From: email@hidden
  • Date: Sun, 21 May 2006 03:10:51 +1000

sampledPoints[++count].x = sampledPoints [count-1].x; <<<<-- warning here

C's operator ordering does not define the case where a variable appears multiple times in the same expression with one or more --/+ +'s. Thus, the compiler could choose to increment count before or after it uses it to index sampledPoints in the second part.


You'll need to figure out which behaviour you really want, and split that up into two or more lines, with count being incremented separately from where it's used as a second index. I'm guessing you just want:

++count;
sampledPoints[count].x = sampledPoints[count - 1].x;

Wade Tregaskis

    ICQ: 40056898
    AIM, Yahoo & Skype: wadetregaskis
    MSN: email@hidden
    iChat & email: email@hidden
    Jabber: email@hidden
    Google Talk: email@hidden

    http://homepage.mac.com/wadetregaskis/

-- Sed quis custodiet ipsos custodes?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >strange "warning: operation on '...' may be undefined" (From: nick briggs <email@hidden>)

  • Prev by Date: strange "warning: operation on '...' may be undefined"
  • Next by Date: Re: strange "warning: operation on '...' may be undefined"
  • Previous by thread: strange "warning: operation on '...' may be undefined"
  • Next by thread: Re: strange "warning: operation on '...' may be undefined"
  • Index(es):
    • Date
    • Thread