summaryrefslogtreecommitdiff
path: root/m4/ax_compiler_flags_cxxflags.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/ax_compiler_flags_cxxflags.m4')
-rw-r--r--m4/ax_compiler_flags_cxxflags.m49
1 files changed, 8 insertions, 1 deletions
diff --git a/m4/ax_compiler_flags_cxxflags.m4 b/m4/ax_compiler_flags_cxxflags.m4
index 8f9c1a2e..6031a6fa 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])
])