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 <christophe.cu...@free.fr>
---
 configure.ac | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8fc3bd0..4c58b1d 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
-- 
2.1.3


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to