Does anybody have any success running clang static analyzer on Windows?
I have successfully built llvm and clang (using VS 2008). Running scan-build results in the following error:
The getpwuid function is unimplemented at scan-build line 35.
Some research shows that getpwuid is no开发者_如何转开发t supported on Windows platforms.
change the call to ...
my $UserName = HtmlEscape('unknown')
scan-build is a perl script, so will need some handy fixes to execute scan build on windows.. these are
-> point those variables to look at the absolute physical path
my $ClangSB, my $Clang; $Dir = "/tmp"; my $Cmd ; and my $CmdCXX
please remember, that my $Cmd ; and my $CmdCXX is path of ccc-analyzer and c++-analyzer ... which are also perl scripts, so please place a perl -w in front of absolute path string..
and also disable the variable check right after declaration...
! -x $blaBla is problematic on windows...
beside you will also need these changes
--> CHANGE
open(PIPE, "-|", $Clang, "-cc1", "-help") or
to
open(PIPE, "-|", "$Clang"." -cc1"." -help") or
surprise, scan-build is working on windows.. :)
精彩评论