Skip to content

Commit

Permalink
Enable more compile warnings on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sionescu committed Nov 13, 2022
1 parent 345464d commit 39767bf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ script:
- |
autoreconf -f -i
tests=disable; if [ "$TRAVIS_OS_NAME" = "linux" ]; then tests=enable; fi
env CFLAGS="${WERR_CFLAGS}" ./configure --${tests}-tests
make -j2 V=1
./configure --${tests}-tests || cat config.log
make -j2 CFLAGS="${WARN_CFLAGS}" V=1
make check V=1
addons:
Expand Down
41 changes: 34 additions & 7 deletions config/travis.cflags.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
#!/bin/bash

WERR_CFLAGS="\
WARN_CFLAGS="\
-O2 \
-Wall -Wextra \
-fno-common \
-Wshadow \
-Wpointer-arith \
-Wformat=2 \
-Wswitch-default \
-Wswitch-enum \
-Wcast-align \
-Wcast-qual \
-Wconversion \
-Wpointer-arith \
-Wbad-function-cast \
-Wstrict-overflow=5 \
-Winline \
-Wundef \
-Wnested-externs \
-Wunreachable-code \
-Wfloat-equal \
-Wstrict-aliasing=2 \
-Wredundant-decls \
-Wold-style-definition \
-Werror=implicit-function-declaration \
-Werror=strict-prototypes \
-Werror=missing-prototypes \
-Werror=missing-braces \
-Werror=missing-field-initializers \
-Werror=varargs \
"
WERR_CFLAGS_OSX="\
-Werror=unguarded-availability-new \
"

if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
WERR_CFLAGS+=" ${WERR_CFLAGS_OSX}";
if [[ ${TRAVIS_OS_NAME} = "osx" ]]; then
WARN_CFLAGS+=" -Werror=unguarded-availability-new";
fi

if [[ ${CC_FOR_BUILD} == "gcc" ]]; then
WARN_CFLAGS+=" -Wlogical-op";
fi

export WERR_CFLAGS
export WARN_CFLAGS

0 comments on commit 39767bf

Please sign in to comment.