From: Joel Rosdahl Date: Sat, 5 Oct 2019 18:13:59 +0000 (+0200) Subject: Make detection of supported Clang warning flags actually work X-Git-Tag: v4.0~774 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3428572dcb4a752c9f5529c3f21b41ba0e68f716;p=thirdparty%2Fccache.git Make detection of supported Clang warning flags actually work As suggested in PR #469. Co-authored-by: Enrico Sorichetti --- diff --git a/configure.ac b/configure.ac index 2a9640fea..971d3959d 100644 --- a/configure.ac +++ b/configure.ac @@ -71,24 +71,24 @@ if test "$dev_mode" = yes -o "$enable_more_warnings" = yes; then extra_warnings="-Wextra -Wpedantic" if test "$ac_compiler_clang" = yes; then extra_warnings="$extra_warnings -Weverything" - AX_CHECK_COMPILE_FLAG(-Wno-c++98-compat, extra_warnings="$extra_warnings -Wno-c++98-compat") - AX_CHECK_COMPILE_FLAG(-Wno-c++98-compat-pedantic, extra_warnings="$extra_warnings -Wno-c++98-compat-pedantic") - AX_CHECK_COMPILE_FLAG(-Wno-conversion, extra_warnings="$extra_warnings -Wno-conversion") - AX_CHECK_COMPILE_FLAG(-Wno-disabled-macro-expansion, extra_warnings="$extra_warnings -Wno-disabled-macro-expansion") - AX_CHECK_COMPILE_FLAG(-Wno-documentation-unknown-command, extra_warnings="$extra_warnings -Wno-documentation-unknown-command") - AX_CHECK_COMPILE_FLAG(-Wno-exit-time-destructors, extra_warnings="$extra_warnings -Wno-exit-time-destructors") - AX_CHECK_COMPILE_FLAG(-Wno-format-nonliteral, extra_warnings="$extra_warnings -Wno-format-nonliteral") - AX_CHECK_COMPILE_FLAG(-Wno-global-constructors, extra_warnings="$extra_warnings -Wno-global-constructors") - AX_CHECK_COMPILE_FLAG(-Wno-implicit-fallthrough, extra_warnings="$extra_warnings -Wno-implicit-fallthrough") - AX_CHECK_COMPILE_FLAG(-Wno-padded, extra_warnings="$extra_warnings -Wno-padded") - AX_CHECK_COMPILE_FLAG(-Wno-shorten-64-to-32, extra_warnings="$extra_warnings -Wno-shorten-64-to-32") - AX_CHECK_COMPILE_FLAG(-Wno-sign-conversion, extra_warnings="$extra_warnings -Wno-sign-conversion") - AX_CHECK_COMPILE_FLAG(-Wno-undefined-func-template, extra_warnings="$extra_warnings -Wno-undefined-func-template") - AX_CHECK_COMPILE_FLAG(-Wno-weak-vtables, extra_warnings="$extra_warnings -Wno-weak-vtables") + AX_CHECK_COMPILE_FLAG([-Wno-c++98-compat], [extra_warnings="$extra_warnings -Wno-c++98-compat"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-c++98-compat-pedantic], [extra_warnings="$extra_warnings -Wno-c++98-compat-pedantic"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-conversion], [extra_warnings="$extra_warnings -Wno-conversion"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-disabled-macro-expansion], [extra_warnings="$extra_warnings -Wno-disabled-macro-expansion"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-documentation-unknown-command], [extra_warnings="$extra_warnings -Wno-documentation-unknown-command"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-exit-time-destructors], [extra_warnings="$extra_warnings -Wno-exit-time-destructors"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-format-nonliteral], [extra_warnings="$extra_warnings -Wno-format-nonliteral"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-global-constructors], [extra_warnings="$extra_warnings -Wno-global-constructors"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough], [extra_warnings="$extra_warnings -Wno-implicit-fallthrough"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-padded], [extra_warnings="$extra_warnings -Wno-padded"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-shorten-64-to-32], [extra_warnings="$extra_warnings -Wno-shorten-64-to-32"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-sign-conversion], [extra_warnings="$extra_warnings -Wno-sign-conversion"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-undefined-func-template], [extra_warnings="$extra_warnings -Wno-undefined-func-template"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-weak-vtables], [extra_warnings="$extra_warnings -Wno-weak-vtables"],, [-Werror]) # TODO: Enable these in the future: - AX_CHECK_COMPILE_FLAG(-Wno-old-style-cast, extra_warnings="$extra_warnings -Wno-old-style-cast") - AX_CHECK_COMPILE_FLAG(-Wno-zero-as-null-pointer-constant, extra_warnings="$extra_warnings -Wno-zero-as-null-pointer-constant") + AX_CHECK_COMPILE_FLAG([-Wno-old-style-cast], [extra_warnings="$extra_warnings -Wno-old-style-cast"],, [-Werror]) + AX_CHECK_COMPILE_FLAG([-Wno-zero-as-null-pointer-constant], [extra_warnings="$extra_warnings -Wno-zero-as-null-pointer-constant"],, [-Werror]) fi fi