travis: Enable -Wsparse-error and fail on new sparse warnings
authorThomas Graf <tgraf@noironetworks.com>
Tue, 11 Nov 2014 13:51:46 +0000 (14:51 +0100)
committerBen Pfaff <blp@nicira.com>
Tue, 11 Nov 2014 15:46:45 +0000 (07:46 -0800)
A new option -Wsparse-error has been introduced to sparse in the
commits:

4d8811 sparse: Make -Werror turn warnigns into errors
fe57af rename -Werror to -Wsparse-error

which makes sparse fail on warnings. Start using the sparse git tree
for verification and make use of the new flag.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
.travis/build.sh
.travis/prepare.sh

index 5dba4fe..1bf0815 100755 (executable)
@@ -39,11 +39,14 @@ if [ "$KERNEL" ] || [ "$DPDK" ]; then
     install_kernel
 fi
 
-[ "$DPDK" ] && {
+if [ "$DPDK" ]; then
     install_dpdk
     # Disregard bad function cassts until DPDK is fixed
     CFLAGS="$CFLAGS -Wno-error=bad-function-cast -Wno-error=cast-align"
-}
+elif [ $CC != "clang" ]; then
+    # DPDK headers currently trigger sparse errors
+    CFLAGS="$CFLAGS -Wsparse-error"
+fi
 
 configure_ovs $*
 
index 6b5df00..f8bd0a1 100755 (executable)
@@ -3,6 +3,5 @@
 sudo apt-get update -qq
 sudo apt-get install -qq libssl-dev llvm-dev
 
-wget https://www.kernel.org/pub/software/devel/sparse/dist/sparse-0.5.0.tar.gz
-tar -xzvf sparse-0.5.0.tar.gz
-cd sparse-0.5.0 && make && sudo make install PREFIX=/usr && cd ..
+git clone git://git.kernel.org/pub/scm/devel/sparse/chrisl/sparse.git
+cd sparse && make && sudo make install PREFIX=/usr && cd ..