Bug 1124033 - Disable C4311 and C4312 in directories exhibiting warnings; r=ehsan

There are a long tail of C4311 and C4312 warnings in VS2015. Rather than
wait until all of them are fixed to land VS2015, we're taking the easy
way out and disabling these warnings in every directory currently
exhibiting a warning. This is evil. But it is a lesser evil than
globally disabling C4311 and C4312. At least with this approach new
C4311 and C4312 warnings in directories that aren't suppressing them
shouldn't be introduced.

MozReview-Commit-ID: 2cwWrjMD6B9

--HG--
extra : rebase_source : 3e7b8ea042765fdf138f5ca93a0f9dab75a95fcd
This commit is contained in:
Gregory Szorc 2016-03-23 17:19:20 -07:00
parent 3b8b70a765
commit 6a9168778b
11 changed files with 43 additions and 0 deletions

View File

@ -183,3 +183,8 @@ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
CXXFLAGS += CONFIG['TK_CFLAGS']
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
if CONFIG['_MSC_VER']:
# This is intended as a temporary workaround to unblock compilation
# on VS2015 in warnings as errors mode.
CXXFLAGS += ['-wd4312']

View File

@ -324,4 +324,9 @@ include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['GNU_CC']:
CXXFLAGS += ['-Wno-error=attributes']
if CONFIG['_MSC_VER']:
# This is intended as a temporary workaround to unblock compilation
# on VS2015 in warnings as errors mode.
CXXFLAGS += ['-wd4312']
FINAL_LIBRARY = 'xul'

View File

@ -57,6 +57,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
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',

View File

@ -136,6 +136,12 @@ SOURCES += [
'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',

View File

@ -34,3 +34,7 @@ USE_LIBS += [
]
OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
# This is intended as a temporary workaround to enable VS2015.
if CONFIG['_MSC_VER']:
CXXFLAGS += ['-wd4312']

View File

@ -129,3 +129,7 @@ USE_LIBS += [
]
OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
# This is intended as a temporary workaround to enable VS2015.
if CONFIG['_MSC_VER']:
CXXFLAGS += ['-wd4312']

View File

@ -670,6 +670,7 @@ if CONFIG['_MSC_VER']:
# 'noexcept' used with no exception handling mode specified;
# termination on exception is not guaranteed. Specify /EHsc
CXXFLAGS += ['-wd4577']
CXXFLAGS += ['-wd4312']
if CONFIG['OS_ARCH'] not in ('WINNT', 'HP-UX'):
OS_LIBS += [

View File

@ -44,3 +44,7 @@ shellmoduleloader.inputs = [
'../js.msg',
'ModuleLoader.js',
]
# This is intended as a temporary workaround to enable VS2015.
if CONFIG['_MSC_VER']:
CXXFLAGS += ['-wd4312']

View File

@ -93,6 +93,7 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
'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':
@ -112,4 +113,5 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
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

View File

@ -24,3 +24,9 @@ USE_LIBS += [
'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']

View File

@ -33,5 +33,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'-wd4717', # recursive on all control paths, function will cause runtime stack overflow
'-wd4996', # 'GetVersionExW': was declared deprecated
'-wd4302', # 'reinterpret_cast': truncation from 'LPCSTR' to 'WORD'
'-wd4311', # 'reinterpret_cast': pointer truncation from 'X' to 'Y'
'-wd4312', # 'reinterpret_cast': conversion from 'DWORD' to 'LPOVERLAPPED' of greater size
]