[systemd-commits] autogen.sh

Thomas H.P. Andersen phomes at kemper.freedesktop.org
Sat Dec 28 13:31:37 PST 2013


 autogen.sh |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a8c78decf0533f6ada9748ba073f861183cda837
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Fri Dec 27 21:57:12 2013 +0100

    autogen: add shortcut for running scan-build
    
    scan-build is a static analyzer in llvm. As ususal static analyzers
    tend to mostly find theoretical bugs in software that has been in
    production for a while. For in-development code it can be useful to
    check if new issues is added as there is a chance to spot real problems
    before release. For systemd we are now down to 297 issues - the vast
    majority are false positives because the tool does not understand the
    cleanup attribute.
    
    Running clang's static analyzer scan-build is a bit messy. You have to
    run both configure and make "inside" the build-scan tool. To have an
    easy shortcut from autogen.sh I thus call both directly from it. This
    makes it different from the other options in autogen.sh. I chose 's'
    for static analysis.
    
    scan-build is in the package clang-analyzer on fedora.

diff --git a/autogen.sh b/autogen.sh
index 91df10a..49d5519 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -65,6 +65,9 @@ elif [ "x$1" = "xa" ]; then
 elif [ "x$1" = "xl" ]; then
         ./configure CC=clang CFLAGS='-g -O0 -ftrapv -Wno-cast-align -Wno-gnu' --enable-kdbus $args
         make clean
+elif [ "x$1" = "xs" ]; then
+        scan-build ./configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args
+        scan-build make
 else
         echo
         echo "----------------------------------------------------------------"



More information about the systemd-commits mailing list