<p dir="ltr"><br>
On 26 May 2015 17:30, "Prasanna Kalever" <<a href="mailto:pkalever@redhat.com">pkalever@redhat.com</a>> wrote:<br>
><br>
> Hi gluster team,<br>
><br>
> Proposal:<br>
><br>
> Using Clang static analyzer tool for gluster project<br>
><br>
><br>
> About Clang:<br>
><br>
> From a very high level view, Clang has two features<br>
><br>
> 1. Clang as a compiler<br>
> 2. Clang as a code analyzer<br>
><br>
> The Idea hear is to use second point i.e Clang as code analyzer and still gcc<br>
> will be our default compiler.<br>
><br>
> The Clang Static Analyzer is a source code analysis tool that finds bugs in C,<br>
> C++, and Objective-C programs. Given the exact same code base, clang-analyzer<br>
> reported ~70 potential issues. clang is an awesome and free tool.<br>
><br>
> The reports from clang-analyzer are in HTML and there's a single file for each<br>
> issue and it generates a nice looking source code with embedded comments about<br>
> which flow that was followed all the way down to the problem.<br>
><br>
><br>
> Why Clang-Analyzer: (Advantages)<br>
><br>
> 1. Since its is an open source tool:<br>
><br>
> * Available to all the developers<br>
> * Easy Access, we can run the tool while we compile the code (say $ scan-build make)<br>
> * No restrictions on Number of Runs per week/day/hour/min ..<br>
> * Defects are Identified before submitting a patch, thus very less chance of<br>
> defect injection into project<br>
><br>
> 2. The Html view of clang is very impressive with all the source code including<br>
> comments of clang-analyzer, which lead to defect line number directly .<br>
><br>
><br>
><br>
> I have attached a sample clang results for geo-replication module run on latest<br>
> 3.7+ glusterfs code, please find them above.<br>
><br>
><br>
> Thanks for your time.<br>
On a relative note, I feel we should try to integrate any of these static analyzer as part of our <a href="http://checkpatch.pl">checkpatch.pl</a> and compare the pre and post report and proceed if the change doesn't introduce any new defects. Thoughts?<br>
><br>
><br>
> Best Regards,<br>
> Prasanna Kumar K.<br>
><br>
><br>
> _______________________________________________<br>
> Gluster-devel mailing list<br>
> <a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
> <a href="http://www.gluster.org/mailman/listinfo/gluster-devel">http://www.gluster.org/mailman/listinfo/gluster-devel</a><br>
><br>
</p>