To add an answer to Adrians as a generic point, talking about building debugging and release:
Here are some factors that affect your builds:
- You are linking to a debugging or version of runtime libs (/ MD vs. / MDD)
NDEBUG (release mode) or _DEBUG (debug mode) #defined_SECURE_SCL (or some equivalent) is defined (or not)- Compiler optimization enabled (to some extent)
The "debug build" usually contains _DEBUG , _SECURE_SCL=1 , /MDd and all compiler optimizers are disabled. This leads to the โsafeโ, โmost testedโ runtime, but should also be the slowest version you can get for your executable. Speed โโand security factors should be completely independent of whether you run your program under the debugger or not! - The debug build gives you maximum security and access to errors, completely independent of whether the program is connected to the debugger.
Next is the non-optimized version of the assembly: that is, you have all the settings for the release mode (NDEBUG, _SECURE_SCL = 0, etc.), but you disable all compiler optimizations. This is good for testing, as the performance will not be too bogged down, and you can debug it completely. Again, the usefulness of this does not depend on whether you run your program under the debugger.
Finally, full optimization will come. ( /Ox + full insertion + whole prg optimization is possible): although this is what you would like to send for performance reasons, most likely you do not have enough people in your company who are actually able to debug this. That is, given the crash dump, someone most likely needs some knowledge of asm and what the compiler outputs in order to understand the meaning of the crash dump (or even some random breakpoint when actually running under the debugger). Again, the pros / cons for a complete selection are independent of prg start / run under the debugger.
source share