From a099073a7ef9a8e22e402592067d636ba00b1ebf Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Wed, 12 Nov 2014 16:07:48 -0800 Subject: [PATCH] Enable warnings. Wno-unused-function is used for the moment because of the checking functions which are currently only used by VERIFY but are not (yet?) ifdefed out in normal builds. --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 1c643133b2..2da5709834 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,19 @@ case $host_os in ;; esac +CFLAGS="$CFLAGS -W" + +warn_CFLAGS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function" +saved_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $warn_CFLAGS" +AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])], + [ AC_MSG_RESULT([yes]) ], + [ AC_MSG_RESULT([no]) + CFLAGS="$saved_CFLAGS" + ]) + + AC_ARG_ENABLE(benchmark, AS_HELP_STRING([--enable-benchmark],[compile benchmark (default is yes)]), [use_benchmark=$enableval],