]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- clang analyze test is used only when assertions are enabled.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Oct 2018 12:42:50 +0000 (12:42 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 2 Oct 2018 12:42:50 +0000 (12:42 +0000)
git-svn-id: file:///svn/unbound/trunk@4930 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
testdata/clang-analysis.tdir/clang-analysis.test

index 1319cb28698fa67cbb67ff2c56465d546b0a88be..2eb32d5a0e78f871011242e33799faa26ce9824c 100644 (file)
@@ -4,6 +4,7 @@
        - Fix testlock code to set noreturn on error routine.
        - Remove unused variable from contrib fastrpz/rpz.c and
          remove unused diagnostic pragmas that themselves generate warnings
+       - clang analyze test is used only when assertions are enabled.
 
 1 October 2018: Wouter
        - tag for release 1.8.1rc1.
index de29bb525dbc18c88a9d7081b2191a11260bd03b..fc5f000a503d48a179366676fc1b436b58aa580a 100644 (file)
@@ -6,11 +6,21 @@
 # common functions
 . ../common.sh
 
+PRE="../.."
 if test ! -x "`which clang 2>&1`"; then
        echo "No clang in path"
        exit 0
 fi
 #echo "have clang"
+# test if assertions are enabled
+if grep "^#define UNBOUND_DEBUG" $PRE/config.h >/dev/null; then
+       :
+else
+       echo "UNBOUND_DEBUG is not enabled, skip test"
+       # no unbound debug means no assertions, and clang analyzer uses
+       # the assertions to make inferences.
+       exit 0
+fi
 
 # read value from Makefile
 # $1: result variable name
@@ -23,7 +33,6 @@ read_value () {
        #echo $1"="'"'"`eval echo '$'$1`"'"'
 }
 
-PRE="../.."
 # read some values from the Makefile
 read_value srcdir '^srcdir=' $PRE/Makefile
 read_value CPPFLAGS '^CPPFLAGS=' $PRE/Makefile