Clang static analyzer: Scan-build: No bugs found with msbuild

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang static analyzer: Scan-build: No bugs found with msbuild

Oleg Smolsky via cfe-dev

Hello developers,

 

I am trying to analyze my c++ visual studio project with clang static analyzer. I have built the clang project from svn repository and added the clang binaries folder to the Path.

 

But, when I run the following command, MSBuild only builds the project and there is no analysis from clang.

 

Project folder>scan-build.bat --use-analyzer=D:\llvm-build\Debug\bin\clang.exe "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" Common.vcxproj

The output I get is

 

Build succeeded. 0 Warning(s) 0 Error(s)

 

Time Elapsed 00:00:04.72 scan-build: Removing directory '\Local\Temp/scan-build-2018-11-15-145207-11916-1' because it contains no reports. scan-build: No bugs found.

 

Could anyone tell me what is wrong here?

 

Thanks in advance!

 

Best regards,

Irin


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang static analyzer: Scan-build: No bugs found with msbuild

Oleg Smolsky via cfe-dev
Hi Irin,

scan-build works by replacing the CC variable with the name of the analyzer,
that might not work on visual studio.
Quick googling suggests that you might be able to extract the compilation database using visual studio plugins,
and then you can run the analyzer on that, using the analyze-build python script (IIRC, it is pip-installable).

George

On Nov 15, 2018, at 6:17 AM, SAMUEL Irin Ann via cfe-dev <[hidden email]> wrote:

Hello developers, 
 
I am trying to analyze my c++ visual studio project with clang static analyzer. I have built the clang project from svn repository and added the clang binaries folder to the Path.
 
But, when I run the following command, MSBuild only builds the project and there is no analysis from clang.
 
Project folder>scan-build.bat --use-analyzer=D:\llvm-build\Debug\bin\clang.exe "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" Common.vcxproj
The output I get is
 
Build succeeded. 0 Warning(s) 0 Error(s)
 
Time Elapsed 00:00:04.72 scan-build: Removing directory '\Local\Temp/scan-build-2018-11-15-145207-11916-1' because it contains no reports. scan-build: No bugs found.
 
Could anyone tell me what is wrong here?
 
Thanks in advance!
 
Best regards, 
Irin
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev