aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/configure.ac
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-01-11 19:51:33 +0100
committerMax <msuraev@sysmocom.de>2017-01-11 19:51:33 +0100
commitfd161ccce8ecaad3ddd32dd8b696902e81593ae3 (patch)
tree995754d4d72693d3b5830a73a263cea8f7473706 /openbsc/configure.ac
parent34be86b93c243d94619a36a6db6c50021b33d36e (diff)
Turn some warnings into errors
Make warnings (when available) related to common memory-related issues into errors to harden the source and decrease chance of errors. Change-Id: Ied9c950dafa65f324cf31298b13b590f56139700
Diffstat (limited to 'openbsc/configure.ac')
-rw-r--r--openbsc/configure.ac8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 0753834f9..9fd732529 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -140,6 +140,14 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
+# FIXME: use CC_CHECK_CFLAG_APPEND([-Werror=implicit])
+AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"])
+AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"])
+AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"])
+AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])
+AX_CHECK_COMPILE_FLAG([-Werror=sizeof-array-argument], [CFLAGS="$CFLAGS -Werror=sizeof-array-argument"])
+AX_CHECK_COMPILE_FLAG([-Werror=sizeof-pointer-memaccess], [CFLAGS="$CFLAGS -Werror=sizeof-pointer-memaccess"])
+
# Coverage build taken from WebKit's configure.in
AC_MSG_CHECKING([whether to enable code coverage support])
AC_ARG_ENABLE(coverage,