[MERGED] openbsc[master]: Turn some compiler warnings into errors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Mon Jan 23 08:38:07 UTC 2017


Max has submitted this change and it was merged.

Change subject: Turn some compiler warnings into errors
......................................................................


Turn some compiler warnings into errors

Re-apply the reverted commit 98bc7fa50d0731864297f8fb82932d480c426ff6, this
time with a clear error message in case autoconf-archive is not installed.

Change-Id: I631bde22e79ec0318eb9c8114db5861a1d635816
Tweaked-by: Neels Hofmeyr <nhofmeyr at sysmocom.de>
---
M debian/control
M openbsc/configure.ac
2 files changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/debian/control b/debian/control
index 44262b9..93b4bd3 100644
--- a/debian/control
+++ b/debian/control
@@ -4,6 +4,7 @@
 Priority: optional
 Build-Depends: debhelper (>= 9),
                autotools-dev,
+               autoconf-archive,
                pkg-config,
                libgtp0-dev,
                libosmocore-dev,
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 0753834..7e244bc 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -25,6 +25,11 @@
 fi
 PKG_PROG_PKG_CONFIG([0.20])
 
+dnl check for AX_CHECK_COMPILE_FLAG
+m4_ifdef([AX_CHECK_COMPILE_FLAG], [], [
+	AC_MSG_ERROR([Please install autoconf-archive; re-run 'autoreconf -fi' for it to take effect.])
+	])
+
 dnl checks for libraries
 AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
 AC_SUBST(LIBRARY_DL)
@@ -140,6 +145,13 @@
 CFLAGS="$saved_CFLAGS"
 AC_SUBST(SYMBOL_VISIBILITY)
 
+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,

-- 
To view, visit https://gerrit.osmocom.org/1637
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I631bde22e79ec0318eb9c8114db5861a1d635816
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list