From ee013b383f38bcaddd602a292414e02842590fb4 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Fri, 11 Jan 2019 16:08:28 +0000 Subject: [PATCH] configure.c: fix AX_GCC_FUNC_ATTRIBUTE detection on custom CFLAGS AX_GCC_FUNC_ATTRIBUTE detect attribute feature by compiler warnings. Custom or unrecognized CFLAGS can causes extra warnings so attribute check failed. Reset CFLAGS and restore after AX_GCC_FUNC_ATTRIBUTE call. Signed-off-by: Andreas Mohr Signed-off-by: Andrew Borodin --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 37c07f85a..946ea0502 100644 --- a/configure.ac +++ b/configure.ac @@ -45,7 +45,13 @@ if test "x$enable_werror" = xyes; then mc_CHECK_ONE_CFLAG([-Werror]) fi +dnl Compiler can generate warnings for unrecognized flags added to CFLAGS +dnl which causes attribute checks to fail +ax_gcc_func_attribute_save_flags=$[]_AC_LANG_PREFIX[]FLAGS +_AC_LANG_PREFIX[]FLAGS= AX_GCC_FUNC_ATTRIBUTE([fallthrough]) +_AC_LANG_PREFIX[]FLAGS=$ax_gcc_func_attribute_save_flags +unset ax_gcc_func_attribute_save_flags LT_INIT