mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
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 <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
149f6b0390
commit
e5efbe0cf2
15
configure.ac
15
configure.ac
@@ -104,6 +104,16 @@ AS_IF([test "x$debug" = "xyes"],
|
|||||||
|
|
||||||
AX_CFLAGS_GCC_OPTION(-Wall)
|
AX_CFLAGS_GCC_OPTION(-Wall)
|
||||||
AX_CFLAGS_GCC_OPTION(-Wextra -Wno-sign-compare)
|
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"],
|
AS_IF([test "x$debug" = "xyes"],
|
||||||
[dnl When debug is enabled, we try to activate more checks from
|
[dnl When debug is enabled, we try to activate more checks from
|
||||||
dnl the compiler. They are on independant check because the
|
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
|
-Wmissing-noreturn dnl clang syntax
|
||||||
])
|
])
|
||||||
dnl
|
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
|
dnl GCC provides a couple of checks to detect incorrect macro uses
|
||||||
AX_CFLAGS_GCC_OPTION([-Wundef])
|
AX_CFLAGS_GCC_OPTION([-Wundef])
|
||||||
WM_CFLAGS_GCC_OPTION_UNUSEDMACROS
|
WM_CFLAGS_GCC_OPTION_UNUSEDMACROS
|
||||||
|
|||||||
Reference in New Issue
Block a user