[Gluster-devel] Proposal: Using LLVM clang-analyzer in gluster development

Prasanna Kalever pkalever at redhat.com
Tue May 26 12:00:35 UTC 2015


Hi gluster team, 

Proposal:

Using Clang static analyzer tool for gluster project


About Clang:

>From a very high level view, Clang has two features

1. Clang as a compiler
2. Clang as a code analyzer

The Idea hear is to use second point i.e Clang as code analyzer and still gcc
will be our default compiler.

The Clang Static Analyzer is a source code analysis tool that finds bugs in C,
C++, and Objective-C programs. Given the exact same code base, clang-analyzer
reported ~70 potential issues. clang is an awesome and free tool.

The reports from clang-analyzer are in HTML and there's a single file for each
issue and it generates a nice looking source code with embedded comments about
which flow that was followed all the way down to the problem.


Why Clang-Analyzer: (Advantages)

 1. Since its is an open source tool:
       
  * Available to all the developers
  * Easy Access, we can run the tool while we compile the code (say $ scan-build make)
  * No restrictions on Number of Runs per week/day/hour/min ..
  * Defects are Identified before submitting a patch, thus very less chance of
    defect injection into project

 2. The Html view of clang is very impressive with all the source code including
    comments of clang-analyzer, which lead to defect line number directly .



I have attached a sample clang results for geo-replication module run on latest
3.7+ glusterfs code, please find them above.


Thanks for your time.


Best Regards, 
Prasanna Kumar K. 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scan-build-geo-repln.tar.bz2
Type: application/x-bzip-compressed-tar
Size: 21180 bytes
Desc: not available
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20150526/58a7e30a/attachment-0001.bin>


More information about the Gluster-devel mailing list