Bug 1076698 - Part 0: Clean up configure.in's list of gcc/clang warnings. r=ted

This commit is contained in:
Chris Peterson 2014-09-23 19:48:47 -07:00
parent 6fe6152e95
commit f6d77259d7
2 changed files with 31 additions and 23 deletions

View File

@ -1412,15 +1412,17 @@ if test "$GNU_CC"; then
fi
fi
# Turn on GNU-specific warnings:
# Turn on gcc/clang warnings:
# https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html
#
# -Wall - turn on a lot of warnings
# -Wpointer-arith - good to have
# -Wdeclaration-after-statement - MSVC doesn't like these
# -Werror=return-type - catches missing returns, zero false positives
# -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size
# -Wtype-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Wint-to-pointer-cast - catches cast to pointer from integer of different size
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wreturn-type - catches missing returns, zero false positives
# -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)
@ -1478,15 +1480,17 @@ if test "$GNU_CXX"; then
# FIXME: Let us build with strict aliasing. bug 414641.
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
# Turn on GNU-specific warnings:
# Turn on gcc/clang warnings:
# https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html
#
# -Wall - turn on a lot of warnings
# -Wpointer-arith - good to have
# -Woverloaded-virtual - ???
# -Werror=return-type - catches missing returns, zero false positives
# -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size
# -Werror=type-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Wint-to-pointer-cast - catches cast to pointer from integer of different size
# -Woverloaded-virtual - function declaration hides virtual function from base class
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wreturn-type - catches missing returns, zero false positives
# -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)

View File

@ -1164,15 +1164,17 @@ if test "$GNU_CC"; then
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)
# Turn on GNU-specific warnings:
# Turn on gcc/clang warnings:
# https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html
#
# -Wall - turn on a lot of warnings
# -Wpointer-arith - good to have
# -Wdeclaration-after-statement - MSVC doesn't like these
# -Werror=return-type - catches missing returns, zero false positives
# -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size
# -Wtype-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Wint-to-pointer-cast - catches cast to pointer from integer of different size
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wreturn-type - catches missing returns, zero false positives
# -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)
@ -1226,16 +1228,18 @@ else
fi
if test "$GNU_CXX"; then
# Turn on GNU-specific warnings:
# Turn on gcc/clang warnings:
# https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Warning-Options.html
#
# -Wall - turn on a lot of warnings
# -Wpointer-arith - good to have
# -Woverloaded-virtual - ???
# -Werror=return-type - catches missing returns, zero false positives
# -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size
# -Wtype-limits - catches overflow bugs, few false positives
# -Wconversion-null - catches conversions between NULL and non-pointer types
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Werror=conversion-null - catches conversions between NULL and non-pointer types
# -Wint-to-pointer-cast - catches cast to pointer from integer of different size
# -Woverloaded-virtual - function declaration hides virtual function from base class
# -Wpointer-arith - catches pointer arithmetic using NULL or sizeof(void)
# -Wreturn-type - catches missing returns, zero false positives
# -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)