summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Rousseau <ludovic.rousseau@free.fr>2016-02-27 17:17:24 +0100
committerLudovic Rousseau <ludovic.rousseau@free.fr>2016-03-02 16:07:22 +0100
commit765a1fbf8b80c62b98e05e6d89cbe5fe32d76169 (patch)
tree22509235bc480cb130b681af622b050a9b549168
parent686ccc284b9c54984fce6a8d2a29d020ede773a9 (diff)
downloadlibusb-765a1fbf8b80c62b98e05e6d89cbe5fe32d76169.tar.gz
travis-CI: fails compilation on warning
The travis-autogen.sh script enable some extra warnings not used by default. The idea is to detect problem as early as possible.
-rw-r--r--.travis.yml2
-rwxr-xr-xtravis-autogen.sh41
2 files changed, 42 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 2745538..585cd6f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,5 +23,5 @@ addons:
script:
- ./autogen.sh && make -j4
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./autogen.sh --disable-udev && make -j4; fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./travis-autogen.sh --disable-udev && make -j4; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd Xcode && xcodebuild -project libusb.xcodeproj ; fi
diff --git a/travis-autogen.sh b/travis-autogen.sh
new file mode 100755
index 0000000..d83e07d
--- /dev/null
+++ b/travis-autogen.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Warnings enabled
+CFLAGS="-Wall -Wextra"
+
+CFLAGS+=" -Wbad-function-cast"
+#CFLAGS+=" -Wcast-align"
+CFLAGS+=" -Wchar-subscripts"
+CFLAGS+=" -Wempty-body"
+CFLAGS+=" -Wformat"
+CFLAGS+=" -Wformat-security"
+CFLAGS+=" -Winit-self"
+CFLAGS+=" -Winline"
+CFLAGS+=" -Wmissing-declarations"
+CFLAGS+=" -Wmissing-include-dirs"
+CFLAGS+=" -Wmissing-prototypes"
+CFLAGS+=" -Wnested-externs"
+CFLAGS+=" -Wold-style-definition"
+CFLAGS+=" -Wpointer-arith"
+CFLAGS+=" -Wredundant-decls"
+CFLAGS+=" -Wshadow"
+CFLAGS+=" -Wstrict-prototypes"
+CFLAGS+=" -Wswitch-enum"
+CFLAGS+=" -Wundef"
+CFLAGS+=" -Wuninitialized"
+CFLAGS+=" -Wunused"
+CFLAGS+=" -Wwrite-strings"
+CFLAGS+=" -fdiagnostics-color=auto"
+
+# warnings disabled on purpose
+CFLAGS+=" -Wno-unused-parameter"
+CFLAGS+=" -Wno-unused-function"
+CFLAGS+=" -Wno-deprecated-declarations"
+
+# should be removed and the code fixed
+CFLAGS+=" -Wno-incompatible-pointer-types-discards-qualifiers"
+
+# fails on warning
+CFLAGS+=" -Werror"
+
+./autogen.sh