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.
This commit is contained in:
Ehsan Akhgari 2015-01-02 21:00:31 -05:00
parent 200776139f
commit 30427db685
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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