summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2020-11-29 20:41:57 +0100
committerRomain Bouvier <skunnyk@alteroot.org>2020-12-08 23:48:52 +0100
commitb7e6c14a353bc03b0911dacc95f5e59f81e95f99 (patch)
tree77096112983764335f17daa309671924719c5e26
parent398c4321da79becdacf0aa052dfb79c3849edea0 (diff)
downloadxfce4-dev-tools-b7e6c14a353bc03b0911dacc95f5e59f81e95f99.tar.gz
use strict CFLAGS to catch common mistakes in ci pipeline
A number of common coding errors are missed by the compiler. They turn up only after release once packages are build with full CFLAGS. Adjust the gitlab CI to catch such errors: -Wall enables a number of diagnostics -Wno-deprecated-declarations will hide a bogus warning. As long as an API exists it can be used. Noone beside a curious developer will actually take the time to do research and look for the replacment. In the wild this warning is just noise in the build log. -Werror=implicit-function-declaration will point out missing includes. In case such errors are not fixed, the resulting code will assume int for function arguments and function return values. -Werror=return-type will point out incorrect return values. The caller will most likely receive just garbage. Signed-off-by: Olaf Hering <olaf@aepfle.de>
-rw-r--r--ci/build_libs.sh9
-rw-r--r--ci/build_project.yml2
2 files changed, 9 insertions, 2 deletions
diff --git a/ci/build_libs.sh b/ci/build_libs.sh
index 2853951..e85c765 100644
--- a/ci/build_libs.sh
+++ b/ci/build_libs.sh
@@ -16,6 +16,13 @@ AUTOGEN_OPTIONS="
--enable-gtk-doc
"
+CFLAGS="
+ -Wall
+ -Wno-deprecated-declarations
+ -Werror=implicit-function-declaration
+ -Werror=return-type
+"
+
# list of git repos in build order
REPOS="${XFCE_BASE}/xfce/xfce4-dev-tools.git
${XFCE_BASE}/xfce/libxfce4util.git
@@ -34,7 +41,7 @@ for URL in ${REPOS}; do
TAG=$(git describe --abbrev=0 --match "$NAME*" 2>/dev/null)
echo "--- Building $NAME ($TAG) ---"
git checkout -b build-$TAG $TAG
- ./autogen.sh $AUTOGEN_OPTIONS
+ env "CFLAGS=${CFLAGS}" ./autogen.sh $AUTOGEN_OPTIONS
make -j${NPROC:-$(nproc)}
make install
echo "$(pwd): $(git describe)" >> /tmp/xfce_build_version_info.txt
diff --git a/ci/build_project.yml b/ci/build_project.yml
index bfccb06..42a890d 100644
--- a/ci/build_project.yml
+++ b/ci/build_project.yml
@@ -33,7 +33,7 @@ distcheck:
.make:
before_script:
- - ./autogen.sh
+ - env "CFLAGS=-Wall -Wno-deprecated-declarations -Werror=implicit-function-declaration -Werror=return-type" ./autogen.sh
rules:
# If there are changes to .po, never run. We also check
# BEFORE_SHA to see if it is zeros, in which case we are