From 3029b659e89caa79b6860c3bbe8cbc18b53af678 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 22 Jun 2017 15:06:58 +0200 Subject: Enable compiler warnings This patch borrows the compiler.m4 script from util-linux to check for compiler support of a number of warning flags and sets them if they are supported. Signed-off-by: David Oberhollenzer --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8db281d..c1cf1d1 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,28 @@ AC_DISABLE_STATIC AC_PROG_CC AC_PROG_INSTALL +## compiler warnings +UL_WARN_ADD([-Wall]) +UL_WARN_ADD([-Wextra]) +UL_WARN_ADD([-Wunused]) +UL_WARN_ADD([-Wmissing-prototypes]) +UL_WARN_ADD([-Wmissing-declarations]) +UL_WARN_ADD([-Wwrite-strings]) +UL_WARN_ADD([-Wjump-misses-init]) +UL_WARN_ADD([-Wuninitialized]) +UL_WARN_ADD([-Winit-self]) +UL_WARN_ADD([-Wlogical-op]) +UL_WARN_ADD([-Wunused-but-set-parameter]) +UL_WARN_ADD([-Wunused-but-set-variable]) +UL_WARN_ADD([-Wunused-parameter]) +UL_WARN_ADD([-Wunused-result]) +UL_WARN_ADD([-Wunused-variable]) + +UL_WARN_ADD([-Wno-shadow]) +UL_WARN_ADD([-Wno-sign-compare]) + +AC_SUBST([WARN_CFLAGS]) + ###### handle configure switches, select dependencies ###### need_clock_gettime="no" -- cgit v1.2.3