Bug 1257331 - Disable C4477 to unblock compilation on VS2015; r?froydnj draft
authorGregory Szorc <gps@mozilla.com>
Wed, 16 Mar 2016 14:51:17 -0700
changeset 341339 5c90329df382b2ac0f2bd921a6c3ffb1a93cf7b8
parent 341338 defdee15dd70b823e22f9a437ba660b74cb1f8e2
child 341342 02d24e7084992401ee1bf4193e56a801fe573522
push id13192
push usergszorc@mozilla.com
push dateWed, 16 Mar 2016 21:51:34 +0000
reviewersfroydnj
bugs1257331
milestone48.0a1
Bug 1257331 - Disable C4477 to unblock compilation on VS2015; r?froydnj As part of unblocking building with VS2015u1 in automation, I'm mass disabling compiler warnings that are turned into errors. This is not the preferred mechanism to fix compilation warnings. So hopefully this patch never lands because someone insists on fixing the underlying problem instead. But if it does land, hopefully the workaround is only temporary. MozReview-Commit-ID: Gmxn11fos9I
xpcom/glue/standalone/moz.build
xpcom/glue/standalone/staticruntime/moz.build
xpcom/glue/staticruntime/moz.build
--- a/xpcom/glue/standalone/moz.build
+++ b/xpcom/glue/standalone/moz.build
@@ -13,16 +13,22 @@ include('../objs.mozbuild')
 
 SOURCES += xpcom_glue_src_cppsrcs
 
 SOURCES += [
     '../nsStringAPI.cpp',
     'nsXPCOMGlue.cpp',
 ]
 
+if CONFIG['_MSC_VER']:
+    # This is intended as a temporary workaround to enable VS2015.
+    # xpcom/glue/standalone/nsXPCOMGlue.cpp(70): warning C4477: 'wprintf' :
+    # format string '%s' requires an argument of type 'wchar_t *', but variadic argument 2 has type 'LPVOID'
+    SOURCES['nsXPCOMGlue.cpp'].flags += ['-wd4477']
+
 Library('xpcomglue')
 
 EXPORTS += [
     'nsXPCOMGlue.h',
 ]
 
 SDK_LIBRARY = True
 
--- a/xpcom/glue/standalone/staticruntime/moz.build
+++ b/xpcom/glue/standalone/staticruntime/moz.build
@@ -21,16 +21,21 @@ SDK_LIBRARY = True
 FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
     # Don't include directives about which CRT to use
     CFLAGS += ['-Zl']
     CXXFLAGS += ['-Zl']
 
+    # This is intended as a temporary workaround to enable VS2015.
+    # xpcom/glue/standalone/nsXPCOMGlue.cpp(70): warning C4477: 'wprintf' :
+    # format string '%s' requires an argument of type 'wchar_t *', but variadic argument 2 has type 'LPVOID'
+    SOURCES['../nsXPCOMGlue.cpp'].flags += ['-wd4477']
+
 DEFINES['XPCOM_GLUE'] = True
 
 LOCAL_INCLUDES += [
     '../../../build',
     '../../../threads',
 ]
 
 # Statically link to the CRT on Windows
--- a/xpcom/glue/staticruntime/moz.build
+++ b/xpcom/glue/staticruntime/moz.build
@@ -21,16 +21,21 @@ SDK_LIBRARY = True
 FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
     # Don't include directives about which CRT to use
     CFLAGS += ['-Zl']
     CXXFLAGS += ['-Zl']
 
+    # This is intended as a temporary workaround to enable VS2015.
+    # xpcom/glue/standalone/nsXPCOMGlue.cpp(70): warning C4477: 'wprintf' :
+    # format string '%s' requires an argument of type 'wchar_t *', but variadic argument 2 has type 'LPVOID'
+    CXXFLAGS += ['-wd4477']
+
 LOCAL_INCLUDES += [
     '../../build',
     '../../threads',
 ]
 
 # Statically link to the CRT on Windows
 USE_STATIC_LIBS = True