1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Don't optimize a block of code?

Discussion in 'iPhone/iPad Programming' started by martay, Jan 17, 2009.

  1. macrumors newbie

    #1
    Is there a way to tell the compiler not to optimize a block of code? Something like this would be nice:

    #pragma dont_optimize

    ... code ...

    #pragma do_optimize


    I'm having an opengles problem that only occurs in release mode, not in debug, and I'd like to narrow it down.
     
  2. macrumors 68030

    PhoneyDeveloper

    #2
    You can set compiler settings on a per file basis, that's it. You'll have to look up the compiler switches that affect optimization, although -O0 should turn off most or all optimizations.
     
  3. macrumors 603

    #3
    If it's one function or method, just move it to a different file. Then you can give that one file a custom build setting that should override the project setting default.

    .
     

Share This Page