Common reasons for bugs in release version not present in debug mode

后端 未结 18 1562
余生分开走
余生分开走 2020-11-28 04:11

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?

18条回答
  •  伪装坚强ぢ
    2020-11-28 04:37

    The CRT library functions behave differently in debug vs release (/MD vs /MDd).

    For example, the debug versions often prefill buffers you pass to the indicated length to verify your claim. Examples include strcpy_s, StringCchCopy, etc. Even if the strings terminate earlier, your szDest better be n bytes long!

提交回复
热议问题