[cfe-dev] Trouble Using scan-build in Windows 7

Lockhart, Jonathan (lockhaja) lockhaja at mail.uc.edu
Mon Jun 10 05:51:48 PDT 2013


Anton and Jordan,

Thank you so much for your prompt replies. I appreciate the assistance you have and will be providing.


Anton,

So based on what you have sent me, then the Clang Static Analyzer, called via scan-build, was not provided in the svn checkout that I performed when getting Clang, is that correct? Is there an svn repository for it that I can check out, or do I just need to go to the source files and get it specifically and add it to the clang/tools directory of my directory?

I also noticed in the commands for clang there is an option for running a static analyzer, albeit I am not sure if they are different from one another and if they are different from the one run by scan-build command, when you pull up the help menu for the clang command. The options are -Xanalyzer and --analyze, if I am remembering those correctly. Could you explain these options to me a little more, if possible?


Regards,
Jon

________________________________
From: Anton Yartsev [anton.yartsev at gmail.com]
Sent: Thursday, June 06, 2013 9:29 PM
To: Lockhart, Jonathan (lockhaja)
Cc: Jordan Rose; cfe-dev Developers
Subject: Re: Trouble Using scan-build in Windows 7

On 07.06.2013 5:24, Anton Yartsev wrote:
Hi  Jonathan,

To use the scan-build you should get the contents of clang\tools\scan-build from Clang sources as Jordan pointed out.
Currently the scan-build script expects the clang executables (clang.exe and clang++.exe) to live in ./clang or ./bin/clang
mistake, ./ or ./bin
directory relative to directory with the scan-build stuff but you can use the --use-analyzer=[Xcode|path to clang] scan-build option to tell scan-build where your clang executables live.
The last thing you should do is to add the path to scan-build to your PATH and then you should be able to use scan-build as it described in http://clang-analyzer.llvm.org/scan-build.html.
Hope I've not missed something.
Feel free to ask and point to problems.

No, cfe-dev is the appropriate list for questions. (Or cfe-users, but to be honest we analyzer folks don't follow that list much and you probably wouldn't have gotten an answer there!)

scan-build is not installed with Clang or LLVM; I believe when the analyzer project first began it wasn't clear if everyone would want it as a part of their default install. You can find the executables in tools\scan-build under your Clang source directory (probably llvm\tools\clang.)

I've CC'd Anton Yartsev, who I know has been running scan-build on Windows for some time. (Not sure which version, though.)
Jordan


On Jun 3, 2013, at 14:13 , "Lockhart, Jonathan (lockhaja)" <lockhaja at mail.uc.edu<mailto:lockhaja at mail.uc.edu>> wrote:

Hello Clang Users and Developers,

I apologize in advance if this is going to the wrong email list, but I thought it would be inappropriate to send it to the dev list.

I am currently working on using Clang and LLVM in some research I am doing. More specifically at this time I am trying to use the Clang Static Analysis Tool. I have been able to follow the instructions on the Static Analysis Tool site as well as the LLVM page for compiling the code with Cmake for use with Visual Studio, and I have successfully built the system using "ALL_BUILD" as well as have testing successfully clang by build "clang-test" in visual studio.

With that said I seem to be able to find the bin file from which all the material from the system was installed. Following the directions, I would believe it to be located in the \bin directory under build but it is not there. I have also search my llvm and build directories with no mention of scan-build being found via inspection or search.

I was wondering if the instructions online were outdated and a newer process for running the Clang Static Analyzer was now used? Is the project even still active and worth me using in the development of my C programs? Is there now a way to use the tool from an IDE on the code you have written, such as through Eclipse or Visual Studio?

These are the questions I currently have as I am stuck after building and testing via the instructions found here:http://clang.llvm.org/get_started.html#build. Any assistance would be most appreciative.

Regards,
Jon Lockhart
PhD Candidate - EE Systems
IEEE Vice President 13/14
University of Cincinnati
lockhaja at mail.uc.edu<mailto:lockhaja at mail.uc.edu>
_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu<mailto:cfe-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




--
Anton



--
Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130610/6c84f758/attachment.html>


More information about the cfe-dev mailing list