diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-02-09 11:47:04 +0000 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-02-09 11:47:04 +0000 |
commit | 03a213d0e45dca350d0224ef63add4c8e83d7ba9 (patch) | |
tree | 6e0e26dfd964df5472a24f7f2331bda5b98bd58d /m4/ax_compiler_flags_cxxflags.m4 | |
parent | 009affc49b7bc86a7a96b191f3d383aa38285a6e (diff) | |
download | autoconf-archive-03a213d0e45dca350d0224ef63add4c8e83d7ba9.tar.gz |
ax_compiler_flags: Disable specific flags as errors as well as warnings
See the new comments for details. Disable specific flags (which were
already disabled) as errors as well as warnings, to prevent -Wall from a
build bot effectively re-enabling them as errors.
Based on
http://cgit.freedesktop.org/telepathy/telepathy-glib/tree/m4/tp-compiler-warnings.m4#n22.
Thanks to Simon McVittie.
Diffstat (limited to 'm4/ax_compiler_flags_cxxflags.m4')
-rw-r--r-- | m4/ax_compiler_flags_cxxflags.m4 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/m4/ax_compiler_flags_cxxflags.m4 b/m4/ax_compiler_flags_cxxflags.m4 index 8f9c1a2..6031a6f 100644 --- a/m4/ax_compiler_flags_cxxflags.m4 +++ b/m4/ax_compiler_flags_cxxflags.m4 @@ -26,7 +26,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 1 +#serial 2 AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[ AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS]) @@ -56,6 +56,10 @@ AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[ $3 dnl ],ax_warn_cxxflags_variable,[$ax_compiler_flags_test]) + # In the flags below, when disabling specific flags, always add *both* + # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) + # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall, + # which effectively turns that flag back on again as an error. AS_IF([test "$ax_enable_compile_warnings" != "no"],[ # "minimum" flags AX_APPEND_COMPILE_FLAGS([ dnl @@ -74,7 +78,9 @@ AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[ -Wmissing-declarations dnl -Wredundant-decls dnl -Wno-unused-parameter dnl + -Wno-error=unused-parameter dnl -Wno-missing-field-initializers dnl + -Wno-error=missing-field-initializers dnl -Wformat=2 dnl -Wcast-align dnl -Wformat-nonliteral dnl @@ -93,6 +99,7 @@ AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[ -Warray-bounds dnl -Wreturn-type dnl -Wno-overloaded-virtual dnl + -Wno-error=overloaded-virtual dnl $5 dnl ],ax_warn_cxxflags_variable,[$ax_compiler_flags_test]) ]) |