0

I have a program written in C+ using some simple directX stuff. I wanted to embed it in my windows library I've built based on class encapsulation of winapi - but never mind that - I don't think that's relevant. At some point in time (not sure when exactly) the release version stopped working, where as debug ran fine. I've started checking the build differences, thinking it was a typical /RTC issue, however different build options (in debug) like /RTCs or /RTCu didn't produce any exceptions. So then I tried to turn of optimizations in release and the program started running. Any optimization level would break the execution so that left me checking options /Og /oy /Ob2 /GS /GF and /Gy that are common between the /O1 and /O2 levels. It turned out disabling /Og made the release version run again with other options of /O1 or /O2 enabled. So the question now is: should I be worried about this? This option is marked as deprecated and I'm not sure now if there's any error in the code I should start looking for. Sure there Are some level 4 warnings but they seem like hair splitting (mostly C4100).

Thanks in advance! Cheers, drinker

drinker
  • 41
  • 7
  • I have very bad news for you. Options are fine, you just have UB somewhere. [Program only crashes as release build — how to debug?](http://stackoverflow.com/a/18513077/1607442) – Ivan Aksamentov - Drop Feb 03 '16 at 17:40
  • Optimizer bugs happen. /Og is deprecated for the past 11 years, that cannot possibly help. Just stop using it. – Hans Passant Feb 03 '16 at 18:03

0 Answers0