]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Make detection of supported Clang warning flags actually work
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 5 Oct 2019 18:13:59 +0000 (20:13 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 5 Oct 2019 19:47:35 +0000 (21:47 +0200)
As suggested in PR #469.

Co-authored-by: Enrico Sorichetti <enricosorichetti@mac.com>
configure.ac

index 2a9640feaa9ac19b65f6147868786a7f49919f09..971d3959d555f3e1003a2375367408e768b54e55 100644 (file)
@@ -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