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