Bug 1257317 - Disable C4312 to unblock compilation on VS2015; r?jesup draft
authorGregory Szorc <gps@mozilla.com>
Wed, 16 Mar 2016 20:06:43 -0700
changeset 341484 60d89953717e3dc02aca52303d70225747a462d5
parent 341483 625d658052a1f90d8820c73bc80fb789cc354e16
child 516401 f7c6757b1d51d9ebf38247d86062f13672615bc8
push id13218
push usergszorc@mozilla.com
push dateThu, 17 Mar 2016 03:58:04 +0000
reviewersjesup
bugs1257317
milestone48.0a1
Bug 1257317 - Disable C4312 to unblock compilation on VS2015; r?jesup 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. That being said, this warning appears to occur in 3rd party code. So our hands may be tied. MozReview-Commit-ID: ChUdmEXoeGc
dom/media/systemservices/moz.build
ipc/glue/moz.build
media/webrtc/moz.build
media/webrtc/signaling/test/moz.build
--- a/dom/media/systemservices/moz.build
+++ b/dom/media/systemservices/moz.build
@@ -52,16 +52,21 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
     else:
         LOCAL_INCLUDES += [
             '%' + '%s/system/media/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
         ]
 
 if CONFIG['_MSC_VER']:
     DEFINES['__PRETTY_FUNCTION__'] = '__FUNCSIG__'
 
+    # This is intended as a temporary workaround to enable building with VS2015.
+    # media\webrtc\trunk\webrtc/base/criticalsection.h(59): warning C4312:
+    # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
+    CXXFLAGS += ['-wd4312']
+
 EXPORTS.mozilla += ['ShmemPool.h',]
 
 EXPORTS.mozilla.media += ['MediaChild.h',
                           'MediaParent.h',
                           'MediaSystemResourceClient.h',
                           'MediaSystemResourceManager.h',
                           'MediaSystemResourceManagerChild.h',
                           'MediaSystemResourceManagerParent.h',
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -131,16 +131,22 @@ SOURCES += [
     'BackgroundChildImpl.cpp',
     'BackgroundParentImpl.cpp',
     'FileDescriptorSetChild.cpp',
     'FileDescriptorSetParent.cpp',
     'GeckoChildProcessHost.cpp',
     'URIUtils.cpp',
 ]
 
+if CONFIG['_MSC_VER']:
+    # This is intended as a temporary hack to support building with VS2015.
+    # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
+    SOURCES['BackgroundChildImpl.cpp'].flags += ['-wd4312']
+    SOURCES['BackgroundParentImpl.cpp'].flags += ['-wd4312']
+
 LOCAL_INCLUDES += [
     '/caps',
     '/dom/broadcastchannel',
     '/dom/indexedDB',
     '/dom/workers',
     '/media/webrtc/trunk',
     '/xpcom/build',
 ]
--- a/media/webrtc/moz.build
+++ b/media/webrtc/moz.build
@@ -88,16 +88,17 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
         'signaling/src/sdp/sipcc/sdp_base64.c',
         'signaling/src/sdp/sipcc/sdp_config.c',
         'signaling/src/sdp/sipcc/sdp_main.c',
         'signaling/src/sdp/sipcc/sdp_services_unix.c',
         'signaling/src/sdp/sipcc/sdp_token.c',
         'signaling/src/sdp/sipcc/sdp_utils.c',
     ]
 
+    GYP_DIRS['signaling'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
     GYP_DIRS['signaling'].non_unified_sources += signaling_non_unified_sources
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     GYP_DIRS += ['trunk/testing']
     GYP_DIRS['trunk/testing'].input = 'trunk/testing/gtest.gyp'
     GYP_DIRS['trunk/testing'].variables = gyp_vars
     # We allow warnings for third-party code that can be updated from upstream.
     GYP_DIRS['trunk/testing'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
@@ -107,9 +108,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk
         GYP_DIRS += ['signalingtest']
         GYP_DIRS['signalingtest'].input = 'signaling/signaling.gyp'
         GYP_DIRS['signalingtest'].variables = gyp_vars.copy()
         GYP_DIRS['signalingtest'].variables.update(
             build_for_test=1,
             moz_webrtc_mediacodec=0,
             build_for_standalone=0
         )
+        GYP_DIRS['signalingtest'].sandbox_vars['ALLOW_COMPILER_WARNINGS'] = True
         GYP_DIRS['signalingtest'].non_unified_sources += signaling_non_unified_sources
--- a/media/webrtc/signaling/test/moz.build
+++ b/media/webrtc/signaling/test/moz.build
@@ -19,8 +19,14 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CO
 include('/ipc/chromium/chromium-config.mozbuild')
 include('common.build')
 
 USE_LIBS += [
     '/media/webrtc/signalingtest/signaling_ecc/ecc',
     'mtransport_s',
 ]
 
+if CONFIG['_MSC_VER']:
+    # This is intended as a temporary workaround to enable warning free building
+    # with VS2015.
+    # reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
+    CXXFLAGS += ['-wd4312']
+