[cfe-dev] How to run the analyzer

Anna Zaks ganna at apple.com
Mon Mar 19 12:00:27 PDT 2012


Ignat,

As far as I know, there are no clang developers who are maintaining/testing the analyzer on Fedora. We don't know how the package is produced. If you are interested in building clang from the source, we would be glad to help you investigate the issues you run into. scan-build is just a perl script which interposes clang on top of your build and is not full proof either.

A few other pointers:
What output does scan-build produce? See http://clang-analyzer.llvm.org/scan-build.html for more info on scan-build.

The analyzer is not guaranteed to find all bugs in the code. For example, it might stop exploring s particular path through the program and not reach the place where the uninitialized pointer is used. Try testing it out on a small project or add a test function containing just a devision by 0 (or null pointer dereference) to the existing project and see if that gets caught.

Anna.

On Mar 17, 2012, at 3:30 AM, Ignat Semenov wrote:

> Hello clang devs!
> 
> I'm a KDE project developer and would like to check the part of the
> code I'm maintaining with the clang static analyzer. My system is as
> follows:
> 
> Fedora 16 64 bit, clang-analyzer package2.9-6.fc16 from the official
> updates repo
> 
> So, I've tried to do
> 
>> scan-build make
> 
> in the build directory of my code module.
> 
> The build ran and scan-build gave me no errors or warnings. However, I
> can for sure see that in that code, there is at least one
> uninitialized pointer being written into.
> 
> What am I doing wrong? Does clang-analyzer support this kind of
> errors? Is Linux supported officially?
> 
> Best regards,
> Ignat Semenov
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120319/da78f1fc/attachment.html>


More information about the cfe-dev mailing list