Re: GC, variable optimized away wrongly?
Re: GC, variable optimized away wrongly?
- Subject: Re: GC, variable optimized away wrongly?
- From: Greg Guerin <email@hidden>
- Date: Wed, 25 Nov 2009 10:26:40 -0700
Nick Rogers wrote:
NSTimeInterval etaDouble = interval * ((totalBlocks -
blockCount) / blockCount); // * debugger doesn't list this
variable, mouse shows a pop up saying "variable optimized away by
compiler"
int eta = (int)etaDouble; // value is 0 here instead of something
What are the types of totalBlocks and blockCount?
Have you confirmed, say by NSLog'ing it, that the value of etaDouble
has a non-zero integer part?
If you NSLog etaDouble, or use it in any way that affects anything
outside the 'for' block, it won't be optimized away.
-- GG
_______________________________________________
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