[cfe-dev] Learning how to use and deploy 'scan-build'

Aleksei Sidorin via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 11 06:26:54 PST 2016


Hello Martin!

11.11.2016 16:48, Martin J. O'Riordan via cfe-dev пишет:
>
> I am working on adding ‘scan-build’ to the set of tools we include 
> with our release of ‘clang’, and trying to determine the minimal set 
> of components needed to be able to successfully use ‘scan-build’.  The 
> documentation for this is fairly thin, so there are many things I am 
> having to learn.
>
> Currently we just provide the compiler itself, along with the headers 
> and libraries for our SHAVE target.  I would like to add a lot of the 
> additional tools and utilities that CLang/LLVM provide with future 
> versions, ‘scan-build’ is one of these, and ‘clang-tidy’, etc., but 
> not a complete set.
>
> In addition to the ‘scan-build’ Perl script itself, I also need the 
> ‘ccc-analyzer’ and ‘c++-analyzer’ Perl scripts, and this appears to 
> run without error; but I would like to know are their other components 
> that I need to ensure that it is fully functional?
>
As I remember, Perl scan-build doesn't have any additional dependencies.
>
> I would like to know what is the “core set” of analysers?  I listed 
> the full set of analysers in ‘clang’ v3.9.0 and some of these names 
> are prefixed with ‘core.’ so I presume these are the ones that 
> comprise the core set?
>
The "core" set is responsible for basic modelling of some functions in 
path-sensitive mode, they are not the analyzer core itself. Shortly, 
analyzer has two kinds of checkers - AST/CFG based (fast) and 
path-sensitive (slow but more powerful). If you need any path-sensitive 
checkers, you should also enable "core" checkers for more precise modelling.

// TODO: enable "core" automatically in such cases?
>
> When enabling others I presume I have to add a comma-separated list to 
> the ‘-enable-checker’ option, for example ‘debug.Stats,unix.Malloc’.  
> The names in the list of checks are formed with separating dot 
> characters, does selecting something like ‘security’ enable all the 
> checkers in the ‘security.*’ group, or do I have to enable them one at 
> a time?
>
To enable a full package, you should just point it. Example: 
"-enable-checker core,security"
>
> Sorry if this is all answered in some part of the documentation I 
> haven’t  found, and please point me at it.
>
You can find some additional information on http://clang-analyzer.llvm.org
>
> Thanks,
>
> MartinO
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


-- 
Best regards,
Aleksei Sidorin
Software Engineer,
IMSWL-IMCG, SRR, Samsung Electronics

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


More information about the cfe-dev mailing list