• 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: GC, variable optimized away wrongly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: NSConnection retaining delegate?
  • Next by Date: Re: Re: URLWithString fails to fails with bad string
  • Previous by thread: Re: GC, variable optimized away wrongly?
  • Next by thread: Custom drawing in IKImageBrowserView fails
  • Index(es):
    • Date
    • Thread