发布版本中的错误的常见原因在调试模式下不存在 [英] Common reasons for bugs in release version not present in debug mode

查看:153
本文介绍了发布版本中的错误的常见原因在调试模式下不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误和异常程序行为的典型原因是仅在发布编译模式下显示,但在调试模式下不会发生?

What are the typical reasons for bugs and abnormal program behavior that manifest themselves only in release compilation mode but which do not occur when in debug mode?

推荐答案

很多时候,在C ++的调试模式下,除非明确说明,否则所有变量都将被初始化为null,而在发布模式下则不会发生。

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.

还检查所有异常,例如与释放模式不直接相关,但有时我们忽略一些关键异常,如VC ++中的mem访问冲突,但至少在其他操作系统(如Linux,Solaris 。理想情况下,你的程序不应该捕获这样严重的异常,如访问一个NULL指针。

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.

这篇关于发布版本中的错误的常见原因在调试模式下不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆