From 30427db68536843435c75302c5b1c013ee4c2e09 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 2 Jan 2015 21:00:31 -0500 Subject: [PATCH] Bug 1117259 - Disable the no-unused-local-typedef warning if clang supports it; r=gps This warning is typically triggered by code which implements some kind of assertion macro, and it's probably not a good indicator of bugs anyway, so there is no good reason to keep it on. --- configure.in | 5 +++++ js/src/configure.in | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/configure.in b/configure.in index 5be7d4f7a97..3be06fff0b3 100644 --- a/configure.in +++ b/configure.in @@ -1533,9 +1533,12 @@ if test "$GNU_CC"; then # Turn off the following warnings that -Wall turns on: # -Wno-unused - lots of violations in third-party code + # -Wno-unused-local-typedef - catches unused typedefs, which are commonly used in assertion macros # _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused" + MOZ_CXX_SUPPORTS_WARNING(-Wno-, unused-local-typedef, ac_cxx_has_wno_unused_local_typedef) + if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then # Don't use -Wcast-align with ICC or clang case "$CPU_ARCH" in @@ -1629,12 +1632,14 @@ if test "$GNU_CXX"; then # Turn off the following warnings that -Wall turns on: # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently # -Wno-inline-new-delete - we inline 'new' and 'delete' in mozalloc + # -Wno-unused-local-typedef - catches unused typedefs, which are commonly used in assertion macros # for performance reasons, and because GCC and clang accept it (though # clang warns about it). # _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof" MOZ_CXX_SUPPORTS_WARNING(-Wno-, inline-new-delete, ac_cxx_has_wno_inline_new_delete) + MOZ_CXX_SUPPORTS_WARNING(-Wno-, unused-local-typedef, ac_cxx_has_wno_unused_local_typedef) if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then # Don't use -Wcast-align with ICC or clang diff --git a/js/src/configure.in b/js/src/configure.in index fbf73417601..0fd975ec4a2 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1250,10 +1250,12 @@ if test "$GNU_CC"; then # Turn off the following warnings that -Wall turns on: # -Wno-unused - lots of violations in third-party code # -Wno-inline-new-delete - we inline 'new' and 'delete' in mozalloc + # -Wno-unused-local-typedef - catches unused typedefs, which are commonly used in assertion macros # _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused" MOZ_CXX_SUPPORTS_WARNING(-Wno-, inline-new-delete, ac_cxx_has_wno_inline_new_delete) + MOZ_CXX_SUPPORTS_WARNING(-Wno-, unused-local-typedef, ac_cxx_has_wno_unused_local_typedef) if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then # Don't use -Wcast-align with ICC or clang @@ -1357,9 +1359,12 @@ if test "$GNU_CXX"; then # Turn off the following warnings that -Wall turns on: # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently + # -Wno-unused-local-typedef - catches unused typedefs, which are commonly used in assertion macros # _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof" + MOZ_CXX_SUPPORTS_WARNING(-Wno-, unused-local-typedef, ac_cxx_has_wno_unused_local_typedef) + if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then # Don't use -Wcast-align with ICC or clang case "$CPU_ARCH" in