From 765a1fbf8b80c62b98e05e6d89cbe5fe32d76169 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Sat, 27 Feb 2016 17:17:24 +0100 Subject: [PATCH] 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. --- .travis.yml | 2 +- travis-autogen.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 travis-autogen.sh 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 -- 2.7.4