stack around the variable * was corrupted

标签:
stackaroundthevariablewascorrupted |
分类: VC |
今天 运行项目的时候,出现了这个问题,
stack around the variable * was corrupted. 翻译意思是 堆栈变量周围已损坏.
http://s3/middle/50a0aa5etc2815f90f372&690around
以下是我写的测试代码:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
}
这个赋值语句真是有意思,用越界的数组进行赋值, 这是我今天运行以前别人写的代码里就出现了这个问题,以前没有遇到过 ,可能以前就没有测试到这个地方,在release 里运行就不会有问题 ,在debug里会报错,是release里设置的问题。
在 项目--属性--C/C++ -- 代码生成 -- 基本运行时检查 设置。release 是默认值 而debug 里是 两者(/RTC1,等同于 /RTCsu)
用 #pragma runtime_checks( "", off )
也可以打开检查很多内容,具体的我不知道怎么翻译,翻译的不太好就不翻译了,不过我看都差不多,可以使用#pragma
runtime_checks( "scu", off )就全部设置了。