From dec32c94610bd776da22f80ff685196575ca1397 Mon Sep 17 00:00:00 2001 From: Ian Neal Date: Sat, 10 Nov 2012 13:18:57 +0000 Subject: [PATCH] Bug 802352 - Port |Bug 797049 - Disable C4351 as an MSVC warning about a change to be standards-compliant in MSVC2005 (!). Also sync up warning-disabling between configure.in and js/src/configure.in, and add comments about the warnings being disabled| to comm-central r=callek --- configure.in | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index 6f28516f59..9ba2498fb5 100644 --- a/configure.in +++ b/configure.in @@ -1744,7 +1744,16 @@ ia64*-hpux*) _DEFINES_CXXFLAGS='-FI $(DEPTH)/comm-config.h -DMOZILLA_CLIENT' CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)" CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)" - CXXFLAGS="$CXXFLAGS -wd4800" # disable warning "forcing value to bool" + # MSVC warning C4345 warns of newly conformant behavior as of VS2003. + # MSVC warning C4351 warns of newly conformant behavior as of VS2005. + # MSVC warning C4800 warns when a value is implicitly cast to bool, + # because this also forces narrowing to a single byte, which can be a + # perf hit. But this matters so little in practice (and often we want + # that behavior) that it's better to turn it off. + CXXFLAGS="$CXXFLAGS -wd4345 -wd4351 -wd4800" + # make 'foo == bar;' error out + CFLAGS="$CFLAGS -we4553" + CXXFLAGS="$CXXFLAGS -we4553" LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib" MOZ_DEBUG_FLAGS='-Zi' MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV' @@ -1757,24 +1766,22 @@ ia64*-hpux*) XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib' LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib' MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)' - if test $_MSC_VER -ge 1400; then - LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT" - dnl For profile-guided optimization - PROFILE_GEN_CFLAGS="-GL" - PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT" - dnl XXX: PGO builds can fail with warnings treated as errors, - dnl specifically "no profile data available" appears to be - dnl treated as an error sometimes. This might be a consequence - dnl of using WARNINGS_AS_ERRORS in some modules, combined - dnl with the linker doing most of the work in the whole-program - dnl optimization/PGO case. I think it's probably a compiler bug, - dnl but we work around it here. - PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952" - dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul. - dnl Probably also a compiler bug, but what can you do? - PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE" - LDFLAGS="$LDFLAGS -DYNAMICBASE" - fi + LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT" + dnl For profile-guided optimization + PROFILE_GEN_CFLAGS="-GL" + PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT" + dnl XXX: PGO builds can fail with warnings treated as errors, + dnl specifically "no profile data available" appears to be + dnl treated as an error sometimes. This might be a consequence + dnl of using WARNINGS_AS_ERRORS in some modules, combined + dnl with the linker doing most of the work in the whole-program + dnl optimization/PGO case. I think it's probably a compiler bug, + dnl but we work around it here. + PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952" + dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul. + dnl Probably also a compiler bug, but what can you do? + PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE" + LDFLAGS="$LDFLAGS -DYNAMICBASE" fi MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg32$(VERSION_NUMBER),$(DEPTH)/mozilla/jpeg)' MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/mozilla/modules/libimg/png)' @@ -1836,16 +1843,13 @@ ia64*-hpux*) AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.]) fi - if test $_MSC_VER -ge 1400; then - LDFLAGS="$LDFLAGS -SAFESEH" - fi - if test -n "$GNU_CC"; then CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport" CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport" else AC_DEFINE(HAVE_STDCALL) DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86" + LDFLAGS="$LDFLAGS -SAFESEH" fi AC_DEFINE(_X86_)