--- /dev/null 2012-06-12 19:42:44.000000000 -0400 +++ mail/thunderbird/files/patch-bugzilla-711895 2012-06-12 15:13:15.000000000 -0400 @@ -0,0 +1,694 @@ +--- mozilla/build/autoconf/compiler-opts.m4.orig 2012-06-01 13:19:12.000000000 -0400 ++++ mozilla/build/autoconf/compiler-opts.m4 2012-06-12 15:11:14.000000000 -0400 +@@ -82,3 +82,49 @@ + fi + + ]) ++ ++dnl GCC and clang will fail if given an unknown warning option like -Wfoobar. ++dnl But later versions won't fail if given an unknown negated warning option ++dnl like -Wno-foobar. So when we are check for support of negated warning ++dnl options, we actually test the positive form, but add the negated form to ++dnl the flags variable. ++ ++AC_DEFUN([MOZ_C_SUPPORTS_WARNING], ++[ ++ AC_CACHE_CHECK(whether the C compiler supports $1$2, $3, ++ [ ++ AC_LANG_SAVE ++ AC_LANG_C ++ _SAVE_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -Werror -W$2" ++ AC_TRY_COMPILE([], ++ [return(0);], ++ $3="yes", ++ $3="no") ++ CFLAGS="$_SAVE_CFLAGS" ++ AC_LANG_RESTORE ++ ]) ++ if test "${$3}" = "yes"; then ++ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} $1$2" ++ fi ++]) ++ ++AC_DEFUN([MOZ_CXX_SUPPORTS_WARNING], ++[ ++ AC_CACHE_CHECK(whether the C++ compiler supports $1$2, $3, ++ [ ++ AC_LANG_SAVE ++ AC_LANG_CPLUSPLUS ++ _SAVE_CXXFLAGS="$CXXFLAGS" ++ CXXFLAGS="$CXXFLAGS -Werror -W$2" ++ AC_TRY_COMPILE([], ++ [return(0);], ++ $3="yes", ++ $3="no") ++ CXXFLAGS="$_SAVE_CXXFLAGS" ++ AC_LANG_RESTORE ++ ]) ++ if test "${$3}" = "yes"; then ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} $1$2" ++ fi ++]) +--- mozilla/configure.in.orig 2012-06-12 14:59:51.000000000 -0400 ++++ mozilla/configure.in 2012-06-12 15:11:14.000000000 -0400 +@@ -1889,15 +1889,27 @@ + _MOZ_RTTI_FLAGS_ON=-frtti + _MOZ_RTTI_FLAGS_OFF=-fno-rtti + +- # Turn on GNU specific features +- # -Wall - turn on all warnings +- # -pedantic - make compiler warn about non-ANSI stuff, and +- # be a little bit stricter ++ # Turn on GNU-specific warnings: ++ # -Wall - turn on a lot of warnings ++ # -pedantic - this is turned on below ++ # -Wpointer-arith - enabled with -pedantic, but good to have even if not + # -Wdeclaration-after-statement - MSVC doesn't like these +- # Warnings slamm took out for now (these were giving more noise than help): +- # -Wbad-function-cast - warns when casting a function to a new return type +- # -Wshadow - removed because it generates more noise than help --pete +- _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith -Wdeclaration-after-statement" ++ # -Werror=return-type - catches missing returns, zero false positives ++ # -Wtype-limits - catches overflow bugs, few false positives ++ # -Wempty-body - catches bugs, e.g. "if (c); foo();", 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, type-limits, ac_c_has_wtype_limits) ++ MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body) ++ ++ # Turn off the following warnings that -Wall/-pedantic turn on: ++ # -Wno-unused - lots of violations in third-party code ++ # -Wno-overlength-strings - we exceed the minimum maximum length frequently ++ # ++ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused" ++ MOZ_C_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_c_has_wno_overlength_strings) ++ + if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then + # Don't use -Wcast-align with ICC or clang + case "$CPU_ARCH" in +@@ -1913,12 +1925,9 @@ + dnl Turn pedantic on but disable the warnings for long long + _PEDANTIC=1 + +- if test -z "$INTEL_CC"; then +- _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W" +- fi +- + _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT' + _USE_CPP_INCLUDE_FLAG=1 ++ + elif test "$SOLARIS_SUNPRO_CC"; then + DSO_CFLAGS='' + if test "$CPU_ARCH" = "sparc"; then +@@ -1946,8 +1955,32 @@ + 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 features +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor" ++ ++ # Turn on GNU-specific warnings: ++ # -Wall - turn on a lot of warnings ++ # -pedantic - this is turned on below ++ # -Wpointer-arith - enabled with -pedantic, but good to have even if not ++ # -Woverloaded-virtual - ??? ++ # -Werror=return-type - catches missing returns, zero false positives ++ # -Wtype-limits - catches overflow bugs, few false positives ++ # -Wempty-body - catches bugs, e.g. "if (c); foo();", 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, type-limits, ac_cxx_has_wtype_limits) ++ MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body) ++ ++ # Turn off the following warnings that -Wall/-pedantic turn on: ++ # -Wno-ctor-dtor-privacy - ??? ++ # -Wno-overlength-strings - we exceed the minimum maximum length frequently ++ # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently ++ # -Wno-variadic-macros - ??? ++ # ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-ctor-dtor-privacy" ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_cxx_has_wno_overlength_strings) ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof) ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, variadic-macros, ac_cxx_has_wno_variadic_macros) ++ + if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then + # Don't use -Wcast-align with ICC or clang + case "$CPU_ARCH" in +@@ -1971,81 +2004,7 @@ + # deleted function syntax. + if test "$CLANG_CXX"; then + _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Wno-extended-offsetof, +- ac_has_wno_extended_offsetof, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-extended-offsetof" +- AC_TRY_COMPILE([$configure_static_assert_macros +- #ifndef __has_warning +- #define __has_warning(x) 0 +- #endif], +- [CONFIGURE_STATIC_ASSERT(__has_warning("-Wextended-offsetof"))], +- ac_has_wno_extended_offsetof="yes", +- ac_has_wno_extended_offsetof="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_extended_offsetof" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-extended-offsetof" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof, +- ac_has_wno_invalid_offsetof, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_wno_invalid_offsetof="yes", +- ac_has_wno_invalid_offsetof="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_invalid_offsetof" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros, +- ac_has_wno_variadic_macros, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-variadic-macros" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_wno_variadic_macros="yes", +- ac_has_wno_variadic_macros="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_variadic_macros" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Werror=return-type, +- ac_has_werror_return_type, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Werror=return-type" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_werror_return_type="yes", +- ac_has_werror_return_type="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_werror_return_type" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type" ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, extended-offsetof, ac_cxx_has_wno_extended_offsetof) + fi + + else +--- mozilla/content/smil/nsSMILAnimationFunction.cpp.orig 2012-06-01 13:19:16.000000000 -0400 ++++ mozilla/content/smil/nsSMILAnimationFunction.cpp 2012-06-12 15:11:14.000000000 -0400 +@@ -671,7 +671,7 @@ + return aProgress; + + PRUint32 i = 0; +- for (; i < numTimes - 2 && aProgress >= mKeyTimes[i+1]; ++i); ++ for (; i < numTimes - 2 && aProgress >= mKeyTimes[i+1]; ++i) { } + + if (aCalcMode == CALC_DISCRETE) { + // discrete calcMode behaviour differs in that each keyTime defines the time +--- mozilla/content/smil/nsSMILTimedElement.cpp.orig 2012-06-01 13:19:16.000000000 -0400 ++++ mozilla/content/smil/nsSMILTimedElement.cpp 2012-06-12 15:11:14.000000000 -0400 +@@ -1767,7 +1767,7 @@ + { + nsSMILInstanceTime* result = nsnull; + while ((result = GetNextGreaterOrEqual(aList, aBase, aPosition)) && +- result->Time() == aBase); ++ result->Time() == aBase) { } + return result; + } + +--- mozilla/content/xslt/src/base/txExpandedNameMap.h.orig 2012-06-01 13:19:17.000000000 -0400 ++++ mozilla/content/xslt/src/base/txExpandedNameMap.h 2012-06-12 15:11:14.000000000 -0400 +@@ -102,8 +102,7 @@ + + const txExpandedName key() + { +- NS_ASSERTION(mCurrentPos >= 0 && +- mCurrentPos < mMap.mItems.Length(), ++ NS_ASSERTION(mCurrentPos < mMap.mItems.Length(), + "invalid position in txExpandedNameMap::iterator"); + return txExpandedName(mMap.mItems[mCurrentPos].mNamespaceID, + mMap.mItems[mCurrentPos].mLocalName); +@@ -112,8 +111,7 @@ + protected: + void* itemValue() + { +- NS_ASSERTION(mCurrentPos >= 0 && +- mCurrentPos < mMap.mItems.Length(), ++ NS_ASSERTION(mCurrentPos < mMap.mItems.Length(), + "invalid position in txExpandedNameMap::iterator"); + return mMap.mItems[mCurrentPos].mValue; + } +--- mozilla/gfx/thebes/gfxFont.h.orig 2012-06-01 13:19:21.000000000 -0400 ++++ mozilla/gfx/thebes/gfxFont.h 2012-06-12 15:11:14.000000000 -0400 +@@ -2293,19 +2293,19 @@ + } + + bool CharIsSpace(PRUint32 aPos) { +- NS_ASSERTION(0 <= aPos && aPos < mCharacterCount, "aPos out of range"); ++ NS_ASSERTION(aPos < mCharacterCount, "aPos out of range"); + return mCharacterGlyphs[aPos].CharIsSpace(); + } + bool CharIsTab(PRUint32 aPos) { +- NS_ASSERTION(0 <= aPos && aPos < mCharacterCount, "aPos out of range"); ++ NS_ASSERTION(aPos < mCharacterCount, "aPos out of range"); + return mCharacterGlyphs[aPos].CharIsTab(); + } + bool CharIsNewline(PRUint32 aPos) { +- NS_ASSERTION(0 <= aPos && aPos < mCharacterCount, "aPos out of range"); ++ NS_ASSERTION(aPos < mCharacterCount, "aPos out of range"); + return mCharacterGlyphs[aPos].CharIsNewline(); + } + bool CharIsLowSurrogate(PRUint32 aPos) { +- NS_ASSERTION(0 <= aPos && aPos < mCharacterCount, "aPos out of range"); ++ NS_ASSERTION(aPos < mCharacterCount, "aPos out of range"); + return mCharacterGlyphs[aPos].CharIsLowSurrogate(); + } + +--- mozilla/gfx/ycbcr/QuellGccWarnings.patch.orig 2012-06-12 15:11:14.000000000 -0400 ++++ mozilla/gfx/ycbcr/QuellGccWarnings.patch 2012-06-12 15:11:14.000000000 -0400 +@@ -0,0 +1,40 @@ ++diff --git a/gfx/ycbcr/yuv_convert.cpp b/gfx/ycbcr/yuv_convert.cpp ++--- a/gfx/ycbcr/yuv_convert.cpp +++++ b/gfx/ycbcr/yuv_convert.cpp ++@@ -337,16 +337,17 @@ NS_GFX_(void) ScaleYCbCrToRGB32(const ui ++ source_dx_uv >> kFractionBits); ++ } ++ } ++ else { ++ ScaleYUVToRGB32Row_C(y_ptr, u_ptr, v_ptr, ++ dest_pixel, width, source_dx); ++ } ++ #else +++ (void)source_dx_uv; ++ ScaleYUVToRGB32Row(y_ptr, u_ptr, v_ptr, ++ dest_pixel, width, source_dx); ++ #endif ++ } ++ } ++ // MMX used for FastConvertYUVToRGB32Row and FilterRows requires emms. ++ if (has_mmx) ++ EMMS(); ++diff --git a/gfx/ycbcr/yuv_row.h b/gfx/ycbcr/yuv_row.h ++--- a/gfx/ycbcr/yuv_row.h +++++ b/gfx/ycbcr/yuv_row.h ++@@ -129,14 +129,14 @@ extern SIMD_ALIGNED(int16 kCoefficientsR ++ #if defined(ARCH_CPU_X86) && !defined(ARCH_CPU_X86_64) ++ #if defined(_MSC_VER) ++ #define EMMS() __asm emms ++ #pragma warning(disable: 4799) ++ #else ++ #define EMMS() asm("emms") ++ #endif ++ #else ++-#define EMMS() +++#define EMMS() ((void)0) ++ #endif ++ ++ } // extern "C" ++ ++ #endif // MEDIA_BASE_YUV_ROW_H_ +--- mozilla/gfx/ycbcr/README.orig 2012-06-01 13:19:21.000000000 -0400 ++++ mozilla/gfx/ycbcr/README 2012-06-12 15:11:14.000000000 -0400 +@@ -25,3 +25,5 @@ + win64.patch: SSE2 optimization for Microsoft Visual C++ x64 version + + TypeFromSize.patch: Bug 656185 - Add a method to detect YUVType from plane sizes. ++ ++QuellGccWarnings.patch: Bug 711895 - Avoid some GCC compilation warnings. +--- mozilla/gfx/ycbcr/update.sh.orig 2012-06-01 13:19:21.000000000 -0400 ++++ mozilla/gfx/ycbcr/update.sh 2012-06-12 15:11:14.000000000 -0400 +@@ -9,3 +9,4 @@ + patch -p3 jsrt, NULL, NULL); + } + ++static JSBool ++jsd_DebugErrorHook(JSContext *cx, const char *message, ++ JSErrorReport *report, void *closure); ++ + void + jsd_DebuggerUnpause(JSDContext* jsdc) + { +--- mozilla/js/src/build/autoconf/compiler-opts.m4.orig 2012-06-01 13:19:23.000000000 -0400 ++++ mozilla/js/src/build/autoconf/compiler-opts.m4 2012-06-12 15:11:14.000000000 -0400 +@@ -82,3 +82,49 @@ + fi + + ]) ++ ++dnl GCC and clang will fail if given an unknown warning option like -Wfoobar. ++dnl But later versions won't fail if given an unknown negated warning option ++dnl like -Wno-foobar. So when we are check for support of negated warning ++dnl options, we actually test the positive form, but add the negated form to ++dnl the flags variable. ++ ++AC_DEFUN([MOZ_C_SUPPORTS_WARNING], ++[ ++ AC_CACHE_CHECK(whether the C compiler supports $1$2, $3, ++ [ ++ AC_LANG_SAVE ++ AC_LANG_C ++ _SAVE_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -Werror -W$2" ++ AC_TRY_COMPILE([], ++ [return(0);], ++ $3="yes", ++ $3="no") ++ CFLAGS="$_SAVE_CFLAGS" ++ AC_LANG_RESTORE ++ ]) ++ if test "${$3}" = "yes"; then ++ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} $1$2" ++ fi ++]) ++ ++AC_DEFUN([MOZ_CXX_SUPPORTS_WARNING], ++[ ++ AC_CACHE_CHECK(whether the C++ compiler supports $1$2, $3, ++ [ ++ AC_LANG_SAVE ++ AC_LANG_CPLUSPLUS ++ _SAVE_CXXFLAGS="$CXXFLAGS" ++ CXXFLAGS="$CXXFLAGS -Werror -W$2" ++ AC_TRY_COMPILE([], ++ [return(0);], ++ $3="yes", ++ $3="no") ++ CXXFLAGS="$_SAVE_CXXFLAGS" ++ AC_LANG_RESTORE ++ ]) ++ if test "${$3}" = "yes"; then ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} $1$2" ++ fi ++]) +--- mozilla/js/src/configure.in.orig 2012-06-12 14:59:51.000000000 -0400 ++++ mozilla/js/src/configure.in 2012-06-12 15:11:14.000000000 -0400 +@@ -1817,14 +1817,27 @@ + _MOZ_RTTI_FLAGS_ON=-frtti + _MOZ_RTTI_FLAGS_OFF=-fno-rtti + +- # Turn on GNU specific features +- # -Wall - turn on all warnings +- # -pedantic - make compiler warn about non-ANSI stuff, and +- # be a little bit stricter +- # Warnings slamm took out for now (these were giving more noise than help): +- # -Wbad-function-cast - warns when casting a function to a new return type +- # -Wshadow - removed because it generates more noise than help --pete +- _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith" ++ # Turn on GNU-specific warnings: ++ # -Wall - turn on a lot of warnings ++ # -pedantic - this is turned on below ++ # -Wpointer-arith - enabled with -pedantic, but good to have even if not ++ # -Wdeclaration-after-statement - MSVC doesn't like these ++ # -Werror=return-type - catches missing returns, zero false positives ++ # -Wtype-limits - catches overflow bugs, few false positives ++ # -Wempty-body - catches bugs, e.g. "if (c); foo();", 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, type-limits, ac_c_has_wtype_limits) ++ MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body) ++ ++ # Turn off the following warnings that -Wall/-pedantic turn on: ++ # -Wno-unused - lots of violations in third-party code ++ # -Wno-overlength-strings - we exceed the minimum maximum length frequently ++ # ++ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused" ++ MOZ_C_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_c_has_wno_overlength_strings) ++ + if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then + # Don't use -Wcast-align with ICC or clang + case "$CPU_ARCH" in +@@ -1840,12 +1853,9 @@ + dnl Turn pedantic on but disable the warnings for long long + _PEDANTIC=1 + +- if test -z "$INTEL_CC"; then +- _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W" +- fi +- + _DEFINES_CFLAGS='-include $(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT' + _USE_CPP_INCLUDE_FLAG=1 ++ + elif test "$SOLARIS_SUNPRO_CC"; then + DSO_CFLAGS='' + if test "$CPU_ARCH" = "sparc"; then +@@ -1871,8 +1881,31 @@ + fi + + if test "$GNU_CXX"; then +- # Turn on GNU specific features +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor" ++ # Turn on GNU-specific warnings: ++ # -Wall - turn on a lot of warnings ++ # -pedantic - this is turned on below ++ # -Wpointer-arith - enabled with -pedantic, but good to have even if not ++ # -Woverloaded-virtual - ??? ++ # -Werror=return-type - catches missing returns, zero false positives ++ # -Wtype-limits - catches overflow bugs, few false positives ++ # -Wempty-body - catches bugs, e.g. "if (c); foo();", 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, type-limits, ac_cxx_has_wtype_limits) ++ MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body) ++ ++ # Turn off the following warnings that -Wall/-pedantic turn on: ++ # -Wno-ctor-dtor-privacy - ??? ++ # -Wno-overlength-strings - we exceed the minimum maximum length frequently ++ # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently ++ # -Wno-variadic-macros - ??? ++ # ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-ctor-dtor-privacy" ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_cxx_has_wno_overlength_strings) ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof) ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, variadic-macros, ac_cxx_has_wno_variadic_macros) ++ + if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then + # Don't use -Wcast-align with ICC or clang + case "$CPU_ARCH" in +@@ -1896,81 +1929,7 @@ + # deleted function syntax. + if test "$CLANG_CXX"; then + _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Wno-extended-offsetof, +- ac_has_wno_extended_offsetof, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-extended-offsetof" +- AC_TRY_COMPILE([$configure_static_assert_macros +- #ifndef __has_warning +- #define __has_warning(x) 0 +- #endif], +- [CONFIGURE_STATIC_ASSERT(__has_warning("-Wextended-offsetof"))], +- ac_has_wno_extended_offsetof="yes", +- ac_has_wno_extended_offsetof="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_extended_offsetof" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-extended-offsetof" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof, +- ac_has_wno_invalid_offsetof, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_wno_invalid_offsetof="yes", +- ac_has_wno_invalid_offsetof="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_invalid_offsetof" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros, +- ac_has_wno_variadic_macros, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-variadic-macros" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_wno_variadic_macros="yes", +- ac_has_wno_variadic_macros="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_variadic_macros" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Werror=return-type, +- ac_has_werror_return_type, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Werror=return-type" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_werror_return_type="yes", +- ac_has_werror_return_type="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_werror_return_type" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type" ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, extended-offsetof, ac_cxx_has_wno_extended_offsetof) + fi + + else +--- mozilla/js/src/jsarray.cpp.orig 2012-06-01 13:19:24.000000000 -0400 ++++ mozilla/js/src/jsarray.cpp 2012-06-12 15:11:14.000000000 -0400 +@@ -405,10 +405,23 @@ + } + + template ++static void ++AssertGreaterThanZero(IndexType index) ++{ ++ JS_ASSERT(index >= 0); ++} ++ ++template<> ++void ++AssertGreaterThanZero(uint32_t index) ++{ ++} ++ ++template + static JSBool + GetElement(JSContext *cx, JSObject *obj, IndexType index, JSBool *hole, Value *vp) + { +- JS_ASSERT(index >= 0); ++ AssertGreaterThanZero(index); + if (obj->isDenseArray() && index < obj->getDenseArrayInitializedLength() && + !(*vp = obj->getDenseArrayElement(uint32_t(index))).isMagic(JS_ARRAY_HOLE)) { + *hole = JS_FALSE; +--- mozilla/js/src/jsgc.cpp.orig 2012-06-01 13:19:24.000000000 -0400 ++++ mozilla/js/src/jsgc.cpp 2012-06-12 15:11:14.000000000 -0400 +@@ -1416,7 +1416,7 @@ + JSCompartment::reduceGCTriggerBytes(size_t amount) + { + JS_ASSERT(amount > 0); +- JS_ASSERT(gcTriggerBytes - amount >= 0); ++ JS_ASSERT(gcTriggerBytes >= amount); + if (gcTriggerBytes - amount < GC_ALLOCATION_THRESHOLD * GC_HEAP_GROWTH_FACTOR) + return; + gcTriggerBytes -= amount; +--- mozilla/js/src/jstypedarray.cpp.orig 2012-06-01 13:19:25.000000000 -0400 ++++ mozilla/js/src/jstypedarray.cpp 2012-06-12 15:11:14.000000000 -0400 +@@ -1767,9 +1767,7 @@ + { + JS_ASSERT(tarray); + +- JS_ASSERT(0 <= begin); + JS_ASSERT(begin <= getLength(tarray)); +- JS_ASSERT(0 <= end); + JS_ASSERT(end <= getLength(tarray)); + + JSObject *bufobj = getBuffer(tarray); +--- mozilla/layout/generic/nsHTMLReflowMetrics.h.orig 2012-06-01 13:19:27.000000000 -0400 ++++ mozilla/layout/generic/nsHTMLReflowMetrics.h 2012-06-12 15:11:14.000000000 -0400 +@@ -71,11 +71,11 @@ + nsRect mRects[2]; + public: + nsRect& Overflow(size_t aIndex) { +- NS_ASSERTION(0 <= aIndex && aIndex < 2, "index out of range"); ++ NS_ASSERTION(aIndex < 2, "index out of range"); + return mRects[aIndex]; + } + const nsRect& Overflow(size_t aIndex) const { +- NS_ASSERTION(0 <= aIndex && aIndex < 2, "index out of range"); ++ NS_ASSERTION(aIndex < 2, "index out of range"); + return mRects[aIndex]; + } + +--- mozilla/other-licenses/android/linker.c.orig 2012-06-01 13:19:38.000000000 -0400 ++++ mozilla/other-licenses/android/linker.c 2012-06-12 15:11:14.000000000 -0400 +@@ -1925,6 +1925,7 @@ + return *(unsigned int *)(si->base + si->plt_rela[num].r_offset); + } + #endif ++ return 0; // NOT REACHED + } + + /* As this function is only referenced from assembly, we need to tell the --- /dev/null 2012-06-12 19:42:44.000000000 -0400 +++ mail/thunderbird/files/patch-bugzilla-724700 2012-06-12 16:15:58.000000000 -0400 @@ -0,0 +1,172 @@ +--- config/autoconf.mk.in.orig 2012-06-01 13:11:49.000000000 -0400 ++++ config/autoconf.mk.in 2012-06-12 16:14:48.000000000 -0400 +@@ -240,7 +240,6 @@ + MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@ + + MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@ +-MOZ_EXCEPTIONS_FLAGS_ON = @_MOZ_EXCEPTIONS_FLAGS_ON@ + + PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@ + PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@ +--- config/rules.mk.orig 2012-06-01 13:11:49.000000000 -0400 ++++ config/rules.mk 2012-06-12 16:14:48.000000000 -0400 +@@ -311,9 +311,6 @@ + + endif # !GNU_CC + +-ifdef ENABLE_CXX_EXCEPTIONS +-CXXFLAGS += $(MOZ_EXCEPTIONS_FLAGS_ON) -DMOZ_CPP_EXCEPTIONS=1 +-endif # ENABLE_CXX_EXCEPTIONS + endif # WINNT + + ifeq ($(SOLARIS_SUNPRO_CXX),1) +--- configure.in.orig 2012-06-01 13:11:49.000000000 -0400 ++++ configure.in 2012-06-12 16:14:48.000000000 -0400 +@@ -580,8 +580,6 @@ + + _MOZ_RTTI_FLAGS_ON='-GR' + _MOZ_RTTI_FLAGS_OFF='-GR-' +- _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc' +- _MOZ_EXCEPTIONS_FLAGS_OFF='' + + dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool', + dnl not something else like "magnetic tape manipulation utility". +@@ -1115,8 +1113,6 @@ + # but that breaks when you have a 64 bit kernel with a 32 bit userland. + OS_TEST="${target_cpu}" + +-_COMPILER_PREFIX= +- + HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'` + + ####################################################################### +@@ -1431,10 +1427,8 @@ + DSO_CFLAGS='' + DSO_PIC_CFLAGS='-fPIC' + ASFLAGS="$ASFLAGS -fPIC" +- _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti +- _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti +- _MOZ_EXCEPTIONS_FLAGS_ON='-fexceptions' +- _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-exceptions' ++ _MOZ_RTTI_FLAGS_ON=-frtti ++ _MOZ_RTTI_FLAGS_OFF=-fno-rtti + + # Turn on GNU specific features + # -Wall - turn on all warnings +@@ -1492,7 +1486,7 @@ + + if test "$GNU_CXX"; then + # FIXME: Let us build with strict aliasing. bug 414641. +- CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" ++ CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing" + # Turn on GNU specific features + _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor" + if test -z "$INTEL_CC"; then +@@ -1516,7 +1510,7 @@ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof" ++ CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof" + AC_TRY_COMPILE([], + [return(0);], + ac_has_wno_invalid_offsetof="yes", +@@ -1525,7 +1519,7 @@ + AC_LANG_RESTORE + ]) + if test "$ac_has_wno_invalid_offsetof" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof" ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof" + fi + + AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros, +@@ -1534,7 +1528,7 @@ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros" ++ CXXFLAGS="$CXXFLAGS -Wno-variadic-macros" + AC_TRY_COMPILE([], + [return(0);], + ac_has_wno_variadic_macros="yes", +@@ -1543,7 +1537,7 @@ + AC_LANG_RESTORE + ]) + if test "$ac_has_wno_variadic_macros" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros" ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros" + fi + + AC_CACHE_CHECK(whether the compiler supports -Werror=return-type, +@@ -2567,9 +2561,7 @@ + NS_USE_NATIVE=1 + AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) + CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__" +- CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions -norunpath -D__FUNCTION__=__func__ -template=no%extdef" +- _MOZ_EXCEPTIONS_FLAGS_ON='-features=except' +- _MOZ_EXCEPTIONS_FLAGS_OFF='-features=no%except' ++ CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef" + LDFLAGS="-xildoff $LDFLAGS" + if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then + _SAVE_LDFLAGS=$LDFLAGS +@@ -6292,7 +6284,7 @@ + _PEDANTIC= ) + if test "$_PEDANTIC"; then + _SAVE_CXXFLAGS=$CXXFLAGS +- CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long" ++ CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long" + AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug]) + AC_TRY_COMPILE([$configure_static_assert_macros], + [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)], +@@ -6302,8 +6294,8 @@ + + case "$result" in + no) +- _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long" +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long" ++ _WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long" ++ _WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long" + ;; + yes) + AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ]) +@@ -6384,31 +6376,7 @@ + fi + fi # ! SKIP_COMPILER_CHECKS + +-dnl ======================================================== +-dnl C++ exceptions (g++/VC/irix6/Sun only - for now) +-dnl Should be smarter and check that the compiler does indeed have exceptions +-dnl ======================================================== +-MOZ_ARG_ENABLE_BOOL(cpp-exceptions, +-[ --enable-cpp-exceptions Enable C++ exceptions ], +-[ _MOZ_CPP_EXCEPTIONS=1 ], +-[ _MOZ_CPP_EXCEPTIONS= ]) +- +-if test "$_MOZ_CPP_EXCEPTIONS"; then +- _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON +- AC_DEFINE(MOZ_CPP_EXCEPTIONS) +-else +- _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF +-fi +- +-AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON) +- +-# Irix & OSF native compilers do not like exception declarations +-# when exceptions are disabled +-if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then +- AC_DEFINE(CPP_THROW_NEW, []) +-else +- AC_DEFINE(CPP_THROW_NEW, [throw()]) +-fi ++AC_DEFINE(CPP_THROW_NEW, [throw()]) + AC_LANG_C + + dnl ======================================================== +@@ -6865,7 +6833,6 @@ + + CXXFLAGS=`echo \ + $_MOZ_RTTI_FLAGS \ +- $_MOZ_EXCEPTIONS_FLAGS \ + $_WARNINGS_CXXFLAGS \ + $CXXFLAGS` + --- /dev/null 2012-06-12 19:42:44.000000000 -0400 +++ mail/thunderbird/files/patch-bugzilla-734080 2012-06-12 16:17:46.000000000 -0400 @@ -0,0 +1,295 @@ +--- aclocal.m4.orig 2012-06-01 13:11:44.000000000 -0400 ++++ aclocal.m4 2012-06-12 16:16:42.000000000 -0400 +@@ -14,6 +14,7 @@ + builtin(include, mozilla/build/autoconf/acwinpaths.m4)dnl + builtin(include, mozilla/build/autoconf/lto.m4)dnl + builtin(include, mozilla/build/autoconf/frameptr.m4)dnl ++builtin(include, mozilla/build/autoconf/compiler-opts.m4)dnl + + MOZ_PROG_CHECKMSYS() + +--- configure.in.orig 2012-06-12 16:14:48.000000000 -0400 ++++ configure.in 2012-06-12 16:16:42.000000000 -0400 +@@ -477,6 +477,20 @@ + fi + fi + ++CLANG_CC= ++CLANG_CXX= ++if test "$GCC" = yes; then ++ if test "`$CC -v 2>&1 | grep -c 'clang version'`" != "0"; then ++ CLANG_CC=1 ++ fi ++fi ++ ++if test "$GXX" = yes; then ++ if test "`$CXX -v 2>&1 | grep -c 'clang version'`" != "0"; then ++ CLANG_CXX=1 ++ fi ++fi ++ + dnl Special win32 checks + dnl ======================================================== + case "$target" in +@@ -838,6 +852,8 @@ + AC_SUBST(GNU_CXX) + AC_SUBST(INTEL_CC) + AC_SUBST(INTEL_CXX) ++AC_SUBST(CLANG_CC) ++AC_SUBST(CLANG_CXX) + + AC_SUBST(STL_FLAGS) + AC_SUBST(MOZ_MSVC_STL_WRAP__Throw) +@@ -1430,16 +1446,28 @@ + _MOZ_RTTI_FLAGS_ON=-frtti + _MOZ_RTTI_FLAGS_OFF=-fno-rtti + +- # Turn on GNU specific features +- # -Wall - turn on all warnings +- # -pedantic - make compiler warn about non-ANSI stuff, and +- # be a little bit stricter +- # Warnings slamm took out for now (these were giving more noise than help): +- # -Wbad-function-cast - warns when casting a function to a new return type +- # -Wshadow - removed because it generates more noise than help --pete +- _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith" +- if test -z "$INTEL_CC"; then +- # Don't use -Wcast-align with ICC ++ # Turn on GNU-specific warnings: ++ # -Wall - turn on a lot of warnings ++ # -pedantic - this is turned on below ++ # -Wpointer-arith - enabled with -pedantic, but good to have even if not ++ # -Werror=declaration-after-statement - MSVC doesn't like these ++ # -Werror=return-type - catches missing returns, zero false positives ++ # -Wtype-limits - catches overflow bugs, few false positives ++ # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives ++ # ++ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Werror=declaration-after-statement" ++ MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type) ++ MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits) ++ MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body) ++ ++ # Turn off the following warnings that -Wall/-pedantic turn on: ++ # -Wno-overlength-strings - we exceed the minimum maximum length frequently ++ # -Wno-unused - lots of violations in third-party code ++ # ++ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-overlength-strings -Wno-unused" ++ ++ if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then ++ # Don't use -Wcast-align with ICC or clang + case "$CPU_ARCH" in + # And don't use it on hppa, ia64, sparc, since it's noisy there + hppa | ia64 | sparc) +@@ -1453,13 +1481,9 @@ + dnl Turn pedantic on but disable the warnings for long long + _PEDANTIC=1 + +- if test -z "$INTEL_CC"; then +- _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W" +- fi +- +- + _DEFINES_CFLAGS='-include $(DEPTH)/comm-config.h -DMOZILLA_CLIENT' + _USE_CPP_INCLUDE_FLAG=1 ++ + elif test "$SOLARIS_SUNPRO_CC"; then + DSO_CFLAGS='' + if test "$CPU_ARCH" = "sparc"; then +@@ -1487,10 +1511,33 @@ + 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 features +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor" +- if test -z "$INTEL_CC"; then +- # Don't use -Wcast-align with ICC ++ ++ # Turn on GNU-specific warnings: ++ # -Wall - turn on a lot of warnings ++ # -pedantic - this is turned on below ++ # -Wpointer-arith - enabled with -pedantic, but good to have even if not ++ # -Woverloaded-virtual - ??? ++ # -Werror=return-type - catches missing returns, zero false positives ++ # -Wtype-limits - catches overflow bugs, few false positives ++ # -Wempty-body - catches bugs, e.g. "if (c); foo();", 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, type-limits, ac_cxx_has_wtype_limits) ++ MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body) ++ ++ # Turn off the following warnings that -Wall/-pedantic turn on: ++ # -Wno-overlength-strings - we exceed the minimum maximum length frequently ++ # -Wno-ctor-dtor-privacy - ??? ++ # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently ++ # -Wno-variadic-macros - ??? ++ # ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-overlength-strings -Wno-ctor-dtor-privacy" ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof) ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, variadic-macros, ac_cxx_has_wno_variadic_macros) ++ ++ if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then ++ # Don't use -Wcast-align with ICC or clang + case "$CPU_ARCH" in + # And don't use it on hppa, ia64, sparc, since it's noisy there + hppa | ia64 | sparc) +@@ -1504,58 +1551,15 @@ + _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/comm-config.h' + _USE_CPP_INCLUDE_FLAG=1 + +- AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof, +- ac_has_wno_invalid_offsetof, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_wno_invalid_offsetof="yes", +- ac_has_wno_invalid_offsetof="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_invalid_offsetof" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros, +- ac_has_wno_variadic_macros, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Wno-variadic-macros" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_wno_variadic_macros="yes", +- ac_has_wno_variadic_macros="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_wno_variadic_macros" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros" +- fi +- +- AC_CACHE_CHECK(whether the compiler supports -Werror=return-type, +- ac_has_werror_return_type, +- [ +- AC_LANG_SAVE +- AC_LANG_CPLUSPLUS +- _SAVE_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -Werror=return-type" +- AC_TRY_COMPILE([], +- [return(0);], +- ac_has_werror_return_type="yes", +- ac_has_werror_return_type="no") +- CXXFLAGS="$_SAVE_CXXFLAGS" +- AC_LANG_RESTORE +- ]) +- if test "$ac_has_werror_return_type" = "yes"; then +- _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type" ++ # Recent clang and gcc support C++11 deleted functions without warnings if ++ # compiling with -std=c++0x or -std=gnu++0x (or c++11 or gnu++11 in very new ++ # versions). We can't use -std=c++0x yet, so gcc's support must remain ++ # unused. But clang's warning can be disabled, so when compiling with clang ++ # we use it to opt out of the warning, enabling (macro-encapsulated) use of ++ # deleted function syntax. ++ if test "$CLANG_CXX"; then ++ _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions" ++ MOZ_CXX_SUPPORTS_WARNING(-Wno-, extended-offsetof, ac_cxx_has_wno_extended_offsetof) + fi + + else +--- db/makefiles.sh.orig 2012-06-01 13:11:49.000000000 -0400 ++++ db/makefiles.sh 2012-06-12 16:16:42.000000000 -0400 +@@ -1,45 +1,45 @@ +-#! /bin/sh +-# ***** BEGIN LICENSE BLOCK ***** +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +-# +-# The contents of this file are subject to the Mozilla Public License Version +-# 1.1 (the "License"); you may not use this file except in compliance with +-# the License. You may obtain a copy of the License at +-# http://www.mozilla.org/MPL/ +-# +-# Software distributed under the License is distributed on an "AS IS" basis, +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +-# for the specific language governing rights and limitations under the +-# License. +-# +-# The Original Code is the the Mozilla build system +-# +-# The Initial Developer of the Original Code is +-# Ben Turner +-# +-# Portions created by the Initial Developer are Copyright (C) 2007 +-# the Initial Developer. All Rights Reserved. +-# +-# Contributor(s): +-# +-# Alternatively, the contents of this file may be used under the terms of +-# either the GNU General Public License Version 2 or later (the "GPL"), or +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +-# in which case the provisions of the GPL or the LGPL are applicable instead +-# of those above. If you wish to allow use of your version of this file only +-# under the terms of either the GPL or the LGPL, and not to allow others to +-# use your version of this file under the terms of the MPL, indicate your +-# decision by deleting the provisions above and replace them with the notice +-# and other provisions required by the GPL or the LGPL. If you do not delete +-# the provisions above, a recipient may use your version of this file under +-# the terms of any one of the MPL, the GPL or the LGPL. +-# +-# ***** END LICENSE BLOCK ***** +- +-add_makefiles " +-db/Makefile +-db/mork/Makefile +-db/mork/public/Makefile +-db/mork/build/Makefile +-db/mork/src/Makefile +-" ++#! /bin/sh ++# ***** BEGIN LICENSE BLOCK ***** ++# Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++# ++# The contents of this file are subject to the Mozilla Public License Version ++# 1.1 (the "License"); you may not use this file except in compliance with ++# the License. You may obtain a copy of the License at ++# http://www.mozilla.org/MPL/ ++# ++# Software distributed under the License is distributed on an "AS IS" basis, ++# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++# for the specific language governing rights and limitations under the ++# License. ++# ++# The Original Code is the the Mozilla build system ++# ++# The Initial Developer of the Original Code is ++# Ben Turner ++# ++# Portions created by the Initial Developer are Copyright (C) 2007 ++# the Initial Developer. All Rights Reserved. ++# ++# Contributor(s): ++# ++# Alternatively, the contents of this file may be used under the terms of ++# either the GNU General Public License Version 2 or later (the "GPL"), or ++# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++# in which case the provisions of the GPL or the LGPL are applicable instead ++# of those above. If you wish to allow use of your version of this file only ++# under the terms of either the GPL or the LGPL, and not to allow others to ++# use your version of this file under the terms of the MPL, indicate your ++# decision by deleting the provisions above and replace them with the notice ++# and other provisions required by the GPL or the LGPL. If you do not delete ++# the provisions above, a recipient may use your version of this file under ++# the terms of any one of the MPL, the GPL or the LGPL. ++# ++# ***** END LICENSE BLOCK ***** ++ ++add_makefiles " ++db/Makefile ++db/mork/Makefile ++db/mork/public/Makefile ++db/mork/build/Makefile ++db/mork/src/Makefile ++" --- mail/thunderbird/files/patch-configure.in.orig 2012-06-12 19:42:07.000000000 -0400 +++ mail/thunderbird/files/patch-configure.in 2012-06-12 19:34:41.000000000 -0400 @@ -1,6 +1,6 @@ ---- configure.in.orig 2011-12-19 14:48:06.000000000 +0100 -+++ configure.in 2011-12-19 15:51:19.000000000 +0100 -@@ -1410,7 +1410,7 @@ +--- configure.in.orig 2012-06-12 18:56:42.000000000 -0400 ++++ configure.in 2012-06-12 19:18:55.000000000 -0400 +@@ -1402,7 +1402,7 @@ CPU_ARCH=sparc ;; @@ -9,7 +9,7 @@ CPU_ARCH="$OS_TEST" ;; -@@ -1430,7 +1430,7 @@ +@@ -1422,7 +1422,7 @@ dnl =============================================================== INTEL_ARCHITECTURE= case "$OS_TEST" in @@ -18,90 +18,16 @@ INTEL_ARCHITECTURE=1 esac -@@ -1753,7 +1753,7 @@ - esac +@@ -3107,6 +3107,8 @@ - case "${host_cpu}" in -- x86_64) -+ amd64 | x86_64) - HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_" - ;; - esac -@@ -2415,6 +2415,9 @@ - x86_64-*) - AC_DEFINE(_AMD64_) - ;; -+ amd64*) -+ AC_DEFINE(_AMD64_) -+ ;; - *) - AC_DEFINE(_CPU_ARCH_NOT_DEFINED) - ;; -@@ -2486,7 +2489,7 @@ - else - DLL_SUFFIX=".so.1.0" - fi -- MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib' -+ MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/local)/lib' - DSO_CFLAGS='' - DSO_PIC_CFLAGS='-fPIC' - DSO_LDOPTS='-shared -fPIC' -@@ -3304,11 +3307,11 @@ - ;; - *) - MOZ_CHECK_PTHREADS(pthreads, -- USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads", -+ USE_PTHREADS=1 _PTHREAD_LDFLAGS="-pthreads", - MOZ_CHECK_PTHREADS(pthread, -- USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread", -+ USE_PTHREADS=1 _PTHREAD_LDFLAGS="-pthread", - MOZ_CHECK_PTHREADS(c_r, -- USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r", -+ USE_PTHREADS=1 _PTHREAD_LDFLAGS="-pthread", - MOZ_CHECK_PTHREADS(c, - USE_PTHREADS=1 - ) -@@ -3383,18 +3386,18 @@ - *-*-freebsd*) - AC_DEFINE(_REENTRANT) - AC_DEFINE(_THREAD_SAFE) -- dnl -pthread links in -lc_r, so don't specify it explicitly. -+ dnl -pthread links in -pthread, so don't specify it explicitly. - if test "$ac_cv_have_dash_pthread" = "yes"; then - _PTHREAD_LDFLAGS="-pthread" - else -- _PTHREAD_LDFLAGS="-lc_r" -+ _PTHREAD_LDFLAGS="-pthread" - fi - ;; - - *-*-openbsd*|*-*-bsdi*) - AC_DEFINE(_REENTRANT) - AC_DEFINE(_THREAD_SAFE) -- dnl -pthread links in -lc_r, so don't specify it explicitly. -+ dnl -pthread links in -pthread, so don't specify it explicitly. - if test "$ac_cv_have_dash_pthread" = "yes"; then - _PTHREAD_LDFLAGS="-pthread" - fi -@@ -3569,7 +3572,7 @@ - ac_cv_func_iconv, - [AC_TRY_LINK([ - #include -- #include -+ #include "/usr/local/include/iconv.h" - ], - [ - iconv_t h = iconv_open("", ""); -@@ -3590,7 +3593,7 @@ - ac_cv_func_const_iconv, - [AC_TRY_COMPILE([ - #include -- #include -+ #include "/usr/local/include/iconv.h" - ], - [ - const char *input = "testing"; -@@ -4383,7 +4386,7 @@ + AC_SUBST(VISIBILITY_FLAGS) + ++MOZ_COMPILER_OPTS ++ + dnl Checks for header files. + dnl ======================================================== + AC_HEADER_DIRENT +@@ -4355,7 +4357,7 @@ LDFLAGS=$_SAVE_LDFLAGS LIBS=$_SAVE_LIBS --- /dev/null 2012-06-12 19:44:00.000000000 -0400 +++ mail/thunderbird/files/patch-mailnews-addrbook-src-nsDirPrefs.cpp 2012-06-11 18:03:08.000000000 -0400 @@ -0,0 +1,20 @@ +--- mailnews/addrbook/src/nsDirPrefs.cpp.orig 2012-06-01 13:11:51.000000000 -0400 ++++ mailnews/addrbook/src/nsDirPrefs.cpp 2012-06-11 18:02:30.000000000 -0400 +@@ -375,7 +375,7 @@ + DIR_Server *s=nsnull; + + switch (position) { +- case DIR_POS_APPEND: ++ case (PRInt32)DIR_POS_APPEND: + /* Do nothing if the request is to append a server that is already + * in the list. + */ +@@ -401,7 +401,7 @@ + wholeList->AppendElement(server); + break; + +- case DIR_POS_DELETE: ++ case (PRInt32)DIR_POS_DELETE: + /* Remove the prefs corresponding to the given server. If the prefName + * value is nsnull, the server has never been saved and there are no + * prefs to remove. --- /dev/null 2012-06-12 19:44:00.000000000 -0400 +++ mail/thunderbird/files/patch-mailnews-compose-src-nsSmtpProtocol.cpp 2012-06-11 17:59:40.000000000 -0400 @@ -0,0 +1,29 @@ +--- mailnews/compose/src/nsSmtpProtocol.cpp.orig 2012-06-01 13:11:51.000000000 -0400 ++++ mailnews/compose/src/nsSmtpProtocol.cpp 2012-06-11 17:58:58.000000000 -0400 +@@ -127,16 +127,16 @@ + + switch (code) + { +- case NS_ERROR_SMTP_SERVER_ERROR: +- case NS_ERROR_TCP_READ_ERROR: +- case NS_ERROR_SMTP_TEMP_SIZE_EXCEEDED: +- case NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_1: +- case NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_2: +- case NS_ERROR_SENDING_FROM_COMMAND: +- case NS_ERROR_SENDING_RCPT_COMMAND: +- case NS_ERROR_SENDING_DATA_COMMAND: +- case NS_ERROR_SENDING_MESSAGE: +- case NS_ERROR_SMTP_GREETING: ++ case (int)NS_ERROR_SMTP_SERVER_ERROR: ++ case (int)NS_ERROR_TCP_READ_ERROR: ++ case (int)NS_ERROR_SMTP_TEMP_SIZE_EXCEEDED: ++ case (int)NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_1: ++ case (int)NS_ERROR_SMTP_PERM_SIZE_EXCEEDED_2: ++ case (int)NS_ERROR_SENDING_FROM_COMMAND: ++ case (int)NS_ERROR_SENDING_RCPT_COMMAND: ++ case (int)NS_ERROR_SENDING_DATA_COMMAND: ++ case (int)NS_ERROR_SENDING_MESSAGE: ++ case (int)NS_ERROR_SMTP_GREETING: + bundle->GetStringFromID(NS_ERROR_GET_CODE(code), getter_Copies(eMsg)); + msg = nsTextFormatter::vsmprintf(eMsg.get(), args); + break;