From f6d77259d7220126000c9169fd88684af813d429 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Tue, 23 Sep 2014 19:48:47 -0700 Subject: [PATCH] Bug 1076698 - Part 0: Clean up configure.in's list of gcc/clang warnings. r=ted --- configure.in | 26 +++++++++++++++----------- js/src/configure.in | 28 ++++++++++++++++------------ 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index ba77d646bf3..73ee0c024d8 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/js/src/configure.in b/js/src/configure.in index a3e6ef7eb22..af82c41fe9e 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -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)