]> granicus.if.org Git - pdns/commitdiff
add -Werror=string-plus-int to travis clang build
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Sun, 20 May 2018 09:07:59 +0000 (11:07 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 24 May 2018 15:54:40 +0000 (17:54 +0200)
build-scripts/travis.sh

index bdaf1060ae32df498f3150601ef29616df0bd728..43c7263cd21177e6e52726c0f24e669d1de5f12f 100755 (executable)
@@ -376,7 +376,7 @@ install_dnsdist() {
 build_auth() {
   run "autoreconf -vi"
   # Build without --enable-botan, no botan 2.x in Travis CI
-  run "CFLAGS='-O1 -Werror=vla' CXXFLAGS='-O1 -Werror=vla' ./configure \
+  run "./configure \
     --with-dynmodules='bind gmysql geoip gpgsql gsqlite3 ldap lua mydns opendbx pipe random remote tinydns godbc lua2' \
     --with-modules='' \
     --with-sqlite3 \
@@ -404,7 +404,7 @@ build_recursor() {
   run "rm -f pdns-recursor-*.tar.bz2"
   run "cd pdns-recursor-*"
   # Build without --enable-botan, no botan 2.x in Travis CI
-  run "CFLAGS='-O1 -Werror=vla' CXXFLAGS='-O1 -Werror=vla' CXX=${COMPILER} ./configure \
+  run "CXX=${COMPILER} ./configure \
     --prefix=$PDNS_RECURSOR_DIR \
     --enable-libsodium \
     --enable-unit-tests \
@@ -420,7 +420,7 @@ build_dnsdist(){
   run "cd pdns/dnsdistdist"
   run "tar xf dnsdist*.tar.bz2"
   run "cd dnsdist-*"
-  run "CFLAGS='-O1 -Werror=vla' CXXFLAGS='-O1 -Werror=vla' ./configure \
+  run "./configure \
     --enable-unit-tests \
     --enable-libsodium \
     --enable-dnscrypt \
@@ -610,6 +610,14 @@ run "wget http://ppa.launchpad.net/kalon33/gamesgiroll/ubuntu/pool/main/libs/lib
 run "sudo dpkg -i libsodium-dev_1.0.3-1~ppa14.04+1_amd64.deb libsodium13_1.0.3-1~ppa14.04+1_amd64.deb"
 run "cd ${TRAVIS_BUILD_DIR}"
 
+compilerflags="-O1 -Werror=vla"
+if [ "$CC" = "clang" ]
+then
+  compilerflags="$compilerflags -Werror=string-plus-int"
+fi
+export CFLAGS=$compilerflags
+export CXXFLAGS=$compilerflags
+
 install_$PDNS_BUILD_PRODUCT
 
 build_$PDNS_BUILD_PRODUCT