Problems with VS2015, and Optimized code

If your having issues with VS2015 C++ and code optimization (I have to use that term very loosely, it is more like, Code Destroyer than optimization), there appears to be a simple way to turn off the “optimizer”.

#pragma optimize( “”, off )

This pragma will turn off all optimization in the code from that point in the code forward, for all functions, etc

To turn it back on

#pragma optimize( “”, on )

I have had to turn off “optimization” at some points because the optimizer, was literally destroying the code. Not setting variables correctly, bouncing around in the “step into, or over”, etc.

for more detailed information,

So just an FYI,


IceWare Inc.

Hello jayice,

As this isn’t a question to be answered, could you please post this in the C++ programming section of our forums? Here is a link for convenience:

I’ll be marking this as resolved with this reply.

Have a nice day!