View Full Version : Don't optimize a block of code?

Jan 17, 2009, 12:28 PM
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.

Jan 17, 2009, 12:47 PM
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.

Jan 17, 2009, 01:13 PM
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.