Common reasons for bugs in release version not present in debug mode
错误和异常程序行为的典型原因是什么,它们仅在释放编译模式下表现出来,但在调试模式下不会发生?
Many times, in debug mode in C++ all variables are null initialized, whereas the same does not happen in release mode unless explicitly stated.
Check for any debug macros and uninitialized variables
Does your program uses threading, then optimization can also cause some issues in release mode.
Also check for all exceptions, for example not directly related to release mode but sometime we just ignore some critical exceptions, like mem access violation in VC++, but the same can be a issue at least in other OS like Linux, Solaris. Ideally your program should not catch such critical exceptions like accessing a NULL pointer.
常见的陷阱是在ASSERT中使用带有副作用的表达式。
Other differences might be:
上一篇: 调试与发布性能