From f2824647f371986cefa4dba7b0e51a54d9798aed Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 11 May 2013 00:07:20 +0200 Subject: [PATCH] Configure: Added some -Wxxx checks when debug mode is enabled We probably don't want our users to have to endure them, so they are enabled only when Debug is activated, because they tend to help keeping the code safe. --- configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 14190807..32ea0d68 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,22 @@ AS_IF([test "x$debug" = "xyes"], AX_CFLAGS_GCC_OPTION(-Wall) AX_CFLAGS_GCC_OPTION(-Wextra -Wno-sign-compare -Wno-unused-parameter) +AS_IF([test "x$debug" = "xyes"], + [dnl When debug is enabled, we try to activate more checks from + dnl the compiler. They are on independant check because the + dnl macro checks all the options at once, but we may have cases + dnl where some options are not supported and we don't want to + dnl loose all of them. + dnl + dnl Floating-point comparison is not a good idea + AX_CFLAGS_GCC_OPTION([-Wfloat-equal]) + dnl + dnl Try to report misuses of '&' versus '&&' and similar + AX_CFLAGS_GCC_OPTION([-Wlogical-op]) + dnl + dnl Use of 'sizeof()' on inappropriate pointer types + AX_CFLAGS_GCC_OPTION([-Wpointer-arith]) +]) dnl Platform-specific Makefile setup dnl ================================