summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-22 15:06:58 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-28 10:27:28 +0200
commit3029b659e89caa79b6860c3bbe8cbc18b53af678 (patch)
tree022a68ccef109294ef30b6dcb976974c1cac1239 /configure.ac
parent9eae3063e62df1ca47213027ad42fff6d0a9b7f4 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 22 insertions, 0 deletions
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"