From e5efbe0cf28b0801fb57b423e6e33c82b3235405 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Mon, 8 Dec 2014 22:42:25 +0100 Subject: [PATCH] configure: make the gcc check for trampolines stronger Because the use of trampolines can be a lot of problems, this patch changes the use of the flag to: - make it an error if possible, so coders are forced to not use them; - always enable them, not just for debug, so we increase the probability to get them caught. Signed-off-by: Christophe CURIS --- configure.ac | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 93cd6ebd..63f7fa39 100644 --- a/configure.ac +++ b/configure.ac @@ -104,6 +104,16 @@ AS_IF([test "x$debug" = "xyes"], AX_CFLAGS_GCC_OPTION(-Wall) AX_CFLAGS_GCC_OPTION(-Wextra -Wno-sign-compare) +dnl +dnl The use of trampolines cause code that can crash on some secured OS, it is +dnl also known to be a source of crash if not used properly, in a more general +dnl way it tends to generate binary code that may not be optimal, and it is +dnl not compatible with the 'nested-func-to-macro' workaround +WM_CFLAGS_CHECK_FIRST([-Wtrampolines], + [-Werror=trampolines dnl try to generate an error if possible + -Wtrampolines dnl if not, try to fall back to a simple warning + ]) +dnl 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 @@ -172,11 +182,6 @@ AS_IF([test "x$debug" = "xyes"], -Wmissing-noreturn dnl clang syntax ]) dnl - dnl The use of trampolines cause code that can crash on some - dnl secured OS, and in a more general way generate binary code - dnl that may not be optimal - AX_CFLAGS_GCC_OPTION([-Wtrampolines]) - dnl dnl GCC provides a couple of checks to detect incorrect macro uses AX_CFLAGS_GCC_OPTION([-Wundef]) WM_CFLAGS_GCC_OPTION_UNUSEDMACROS