diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4 index c6ea84570021..94fb7f86f005 100644 --- a/build/autoconf/compiler-opts.m4 +++ b/build/autoconf/compiler-opts.m4 @@ -445,6 +445,7 @@ AC_DEFUN([MOZ_SET_WARNINGS_CFLAGS], # -Wclass-varargs - catches objects passed by value to variadic functions. # -Wloop-analysis - catches issues around loops # -Wnon-literal-null-conversion - catches expressions used as a null pointer constant + # -Wstring-conversion - catches string literals used in boolean expressions # -Wthread-safety - catches inconsistent use of mutexes # # XXX: at the time of writing, the version of clang used on the OS X test @@ -461,6 +462,7 @@ AC_DEFUN([MOZ_SET_WARNINGS_CFLAGS], MOZ_C_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_c_has_non_literal_null_conversion) fi + MOZ_C_SUPPORTS_WARNING(-W, string-conversion, ac_c_has_wstring_conversion) MOZ_C_SUPPORTS_WARNING(-W, thread-safety, ac_c_has_wthread_safety) # Turn off some non-useful warnings that -Wall turns on. @@ -511,6 +513,7 @@ AC_DEFUN([MOZ_SET_WARNINGS_CXXFLAGS], # -Wimplicit-fallthrough - catches unintentional switch case fallthroughs # -Wloop-analysis - catches issues around loops # -Wnon-literal-null-conversion - catches expressions used as a null pointer constant + # -Wstring-conversion - catches string literals used in boolean expressions # -Wthread-safety - catches inconsistent use of mutexes # # XXX: at the time of writing, the version of clang used on the OS X test @@ -532,6 +535,7 @@ AC_DEFUN([MOZ_SET_WARNINGS_CXXFLAGS], MOZ_CXX_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_cxx_has_non_literal_null_conversion) fi + MOZ_CXX_SUPPORTS_WARNING(-W, string-conversion, ac_cxx_has_wstring_conversion) MOZ_CXX_SUPPORTS_WARNING(-W, thread-safety, ac_cxx_has_wthread_safety) # Turn off some non-useful warnings that -Wall turns on.