Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 代码分析在VS 2010中不起作用-代码分析完成--0个错误,0个警告_C++_Visual Studio 2010_Code Analysis_Static Analysis - Fatal编程技术网

C++ 代码分析在VS 2010中不起作用-代码分析完成--0个错误,0个警告

C++ 代码分析在VS 2010中不起作用-代码分析完成--0个错误,0个警告,c++,visual-studio-2010,code-analysis,static-analysis,C++,Visual Studio 2010,Code Analysis,Static Analysis,我试图在VS2010中使用代码分析,但它不起作用 我的示例应用程序: #include "stdafx.h" #include <malloc.h> int getj() { return 10; } int a(int *n) { int b = *n; int c = 1/b; return c; } int _tmain(int argc, _TCHAR* argv[]) { int *a;

我试图在VS2010中使用代码分析,但它不起作用

我的示例应用程序:

#include "stdafx.h"
#include <malloc.h>

int getj() {
        return 10;
}

int a(int *n) {
        int b = *n;
        int c = 1/b;
        return c;
}

int _tmain(int argc, _TCHAR* argv[]) {
        int *a;

        a = (int *)malloc(10*sizeof(int));
        if( a ) {
                free( a );
                a[0] = 12;
                a[getj()] = 12;
        }

        return 0;
}
配置:

在属性页上,我已打开:

-已启用代码分析ob生成定义

-为C/C++在构建时启用代码分析

-Superss源于

-和规则集->所有规则

我的问题是我做错了什么,或者如何在VS2010中运行代码分析


“从Primewindow C++命令行/ZIO/NORO/W3/WX-//WO3/D/Win32/D调试/ D控制台/ D Unicode /D Unicode/GM/EHSC/RTC1/GS/FP:Dealth/ZC:WCARAYT/ZC:FiScCy/YuSTDAFX .H/FPDECHG\Test1.PCH/FAdUDG\/FoDebug \FDDebug \ VC100.PDB/GD/Sypult/DealReReq:QueNe:
1>------ Rebuild All started: Project: test1, Configuration: Debug Win32 ------
1>Build started 2013-07-01 17:45:40.
1>_PrepareForClean:
1>  Deleting file "Debug\test1.lastbuildstate".
1>InitializeBuildStatus:
1>  Creating "Debug\test1.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1>  stdafx.cpp
1>  test1.cpp
1>Manifest:
1>  Deleting file "Debug\test1.exe.embed.manifest".
1>LinkEmbedManifest:
1>  test1.vcxproj -> D:\test1\Debug\test1.exe
1>RunCodeAnalysis:
1>  Running Code Analysis...
1>  **Code Analysis Complete -- 0 error(s), 0 warning(s)**
1>FinalizeBuildStatus:
1>  Deleting file "Debug\test1.unsuccessfulbuild".
1>  Touching "Debug\test1.lastbuildstate".
1>![enter image description here][1]
1>Build succeeded.
1>
1>Time Elapsed 00:00:03.40
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========