0

For the MS Visual Studio C++ Runtime is there a way to disable the Windows Assertion Dialog via an environment variable or in some other non-invasive external way? That is, do this without recompiling. This solution or this one point one in the right direction to using _CrtSetReportMode, but it requires rebuilding the program, and I can't do that.

Is there an environment variable or something that I can set to so that child processes just exit with the appropriate error code? I don't want to disable this for all programs, just this one (hence why an environment variable would be appropriate), but if a global setting or something is all I can get then so be it.

Maybe there's a better higher level approach that avoids the problem? I have a testing program that is executing a program on multiple inputs. The child program can assert at times, and I just want to record the result and continue.

Tim
  • 2,708
  • 1
  • 18
  • 32
  • You *must* rebuild the program, you cannot ship anything built with the Debug configuration. And it is quite pointless to test it, non-optimized code doesn't suffer from the same kind of flaws. Contact whomever provided you with the executable code and ask for the correct build. – Hans Passant Mar 29 '19 at 18:36
  • You're philosophically right. This project misuses the intent of asserts. They use them where a non-zero exit with diagnostic is more appropriate. It is extremely frustrating. Worst case, I can temporarily modify the source, but I was hoping for some external configuration. – Tim Mar 29 '19 at 18:50

0 Answers0