I'm trying to use Code Analysis in VS2010, but it's not working.
My sample appl:
#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;
}
To start analysis, I using "Analyze-> Run Code Analysis on ...."
and logs :
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 ==========
Config:
On the "Property page", I have turned on:
-Enabled Code Analysis ob Build (defines....
-Enabled Code Analysis for C/C++ on Build
-Supress results from ...
-and Ruls Set ->AllRules
My question is what I'm doing wrong, or how to run code analysis in VS2010 ?
thanks