Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

martay

macrumors newbie
Original poster
Oct 1, 2008
24
0
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.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
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.
 

firewood

macrumors G3
Jul 29, 2003
8,141
1,384
Silicon Valley
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.

.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.