Bug 1076698 - Part 1: Remove unnecessary MOZ_*_SUPPORTS_WARNING checks for warnings supported by gcc 4.4+ and clang. r=ted

This commit is contained in:
Chris Peterson 2014-09-23 19:48:47 -07:00
parent 38bb9255d0
commit d943611ddc
2 changed files with 44 additions and 26 deletions

View File

@ -1424,12 +1424,16 @@ if test "$GNU_CC"; then
# -Wsign-compare - catches comparison of signed and unsigned types
# -Wtype-limits - catches overflow bugs, few false positives
#
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type)
MOZ_C_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_c_has_werror_int_to_pointer_cast)
MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits)
MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body)
MOZ_C_SUPPORTS_WARNING(-W, sign-compare, ac_c_has_sign_compare)
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wdeclaration-after-statement"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wempty-body"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wpointer-arith"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wsign-compare"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
# Treat some warnings as errors:
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=int-to-pointer-cast"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=return-type"
# Turn off the following warnings that -Wall turns on:
# -Wno-unused - lots of violations in third-party code
@ -1492,12 +1496,16 @@ if test "$GNU_CXX"; then
# -Wsign-compare - catches comparison of signed and unsigned types
# -Wtype-limits - catches overflow bugs, few false positives
#
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
MOZ_CXX_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_cxx_has_werror_int_to_pointer_cast)
MOZ_CXX_SUPPORTS_WARNING(-W, error=type-limits, ac_cxx_has_werror_type_limits)
MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
MOZ_CXX_SUPPORTS_WARNING(-W, sign-compare, ac_cxx_has_sign_compare)
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wempty-body"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Woverloaded-virtual"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wpointer-arith"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wsign-compare"
# Treat some warnings as errors:
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=int-to-pointer-cast"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=type-limits"
# Turn off the following warnings that -Wall turns on:
# -Wno-invalid-offsetof - we use offsetof on non-POD types frequently
@ -1505,7 +1513,8 @@ if test "$GNU_CXX"; then
# for performance reasons, and because GCC and clang accept it (though
# clang warns about it).
#
MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof)
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof"
MOZ_CXX_SUPPORTS_WARNING(-Wno-, inline-new-delete, ac_cxx_has_wno_inline_new_delete)
if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then

View File

@ -1176,12 +1176,16 @@ if test "$GNU_CC"; then
# -Wsign-compare - catches comparison of signed and unsigned types
# -Wtype-limits - catches overflow bugs, few false positives
#
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type)
MOZ_C_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_c_has_werror_int_to_pointer_cast)
MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits)
MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body)
MOZ_C_SUPPORTS_WARNING(-W, sign-compare, ac_c_has_sign_compare)
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wdeclaration-after-statement"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wempty-body"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wpointer-arith"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wsign-compare"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wtype-limits"
# Treat some warnings as errors:
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=int-to-pointer-cast"
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=return-type"
# Turn off the following warnings that -Wall turns on:
# -Wno-unused - lots of violations in third-party code
@ -1241,18 +1245,23 @@ if test "$GNU_CXX"; then
# -Wsign-compare - catches comparison of signed and unsigned types
# -Wtype-limits - catches overflow bugs, few false positives
#
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
MOZ_CXX_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_cxx_has_werror_int_to_pointer_cast)
MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits)
MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wempty-body"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Woverloaded-virtual"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wpointer-arith"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wsign-compare"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wtype-limits"
# Treat some warnings as errors:
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=int-to-pointer-cast"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type"
MOZ_CXX_SUPPORTS_WARNING(-W, error=conversion-null, ac_cxx_has_werror_conversion_null)
MOZ_CXX_SUPPORTS_WARNING(-W, sign-compare, ac_cxx_has_sign_compare)
# Turn off the following warnings that -Wall turns on:
# -Wno-invalid-offsetof - we use offsetof on non-POD types frequently
#
MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof)
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof"
if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then
# Don't use -Wcast-align with ICC or clang