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