diff options
author | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2015-06-04 14:55:17 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-06-07 06:56:09 -0700 |
commit | bdde0cfa1d5848e59d20c1adc19ee1b687eec66a (patch) | |
tree | 0334c553b9349b5f5e5da1bda4673c97e99ab010 /extras/Makefile.am | |
parent | 093902319ccc3d6bbb954fc40944a9e23aa68344 (diff) |
clang-analyzer: adding clang static analysis support
clang static analyzer is a source code analysis tool that
finds bugs in C, C++.
This patch automates clang analyzes part by integrating
it with 'make clang-check'
clang-checker.sh: runs clang analyzer with and without the
HEAD commit, and shows the bugs introduced by HEAD commit (if any)
sample report:
$[ glusterfs ]: make clang-check
================ Clang analyzer in progress ================
...
BASELINE BUGS LIST (before applying patch):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Out of bound array access --> 3
Memory leak --> 1
Unix API --> 24
Dead increment --> 5
Dereference of null pointer --> 1995
Uninitialized argument value --> 2
All Bugs --> 2872
Called function pointer is null null dereference --> 4
Dead initialization --> 49
Dead assignment --> 691
Undefined allocation of 0 bytes CERT MEM0 C CWE --> 5
Argument with nonnull attribute passed null --> 84
Result of operation is garbage or undefined --> 9
TARGET BUGS LIST (after applying patch):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Out of bound array access --> 3
Memory leak --> 1
Unix API --> 24
Dead increment --> 5
Dereference of null pointer --> 1995
Uninitialized argument value --> 2
All Bugs --> 2875
Called function pointer is null null
dereference --> 4
Dead initialization --> 49
Dead assignment --> 694
Undefined allocation of 0 bytes CERT MEM0 C CWE --> 5
Argument with nonnull attribute passed null --> 84
Result of operation is garbage or undefined --> 9
SUMMARY OF CLANG-ANALYZER:
~~~~~~~~~~~~~~~~~~~~~~~~~~
Extra 3 Bug[s] Introduced in: Dead assignment
Patch Value given by Clang analyzer '-1'
Explore complete results at
/home/user/work/glusterfs/baseline/results/index.html
/home/user/work/glusterfs/target/results/index.html
================= Done with Clang Analysis =================
Change-Id: I512e33cfc02885a111152fbc1832144261dda1da
BUG: 1228142
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Reviewed-on: http://review.gluster.org/11083
Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'extras/Makefile.am')
-rw-r--r-- | extras/Makefile.am | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extras/Makefile.am b/extras/Makefile.am index 609d497f5b8..91c25c65fe6 100644 --- a/extras/Makefile.am +++ b/extras/Makefile.am @@ -22,7 +22,7 @@ EXTRA_DIST = $(conf_DATA) specgen.scm glusterfs-mode.el glusterfs.vim \ disk_usage_sync.sh clear_xattrs.sh glusterd-sysconfig glusterd.vol \ post-upgrade-script-for-quota.sh pre-upgrade-script-for-quota.sh \ command-completion/gluster.bash command-completion/Makefile \ - command-completion/README stop-all-gluster-processes.sh + command-completion/README stop-all-gluster-processes.sh clang-checker.sh install-data-local: if [ -n "$(tmpfilesdir)" ]; then \ |