Re: strange "warning: operation on '...' may be undefined"
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