Bug 1397942 - Disable C5037 in xpcom/string to workaround MSVC bug. r=froydnj
authorXidorn Quan <me@upsuper.org>
Fri, 08 Sep 2017 15:08:39 +1000
changeset 429633 867e6e5787faddab1603b38d895862c2657b909d
parent 429632 f51248231d0ee838862a33ffacce06612e284bd8
child 429634 9bc9a098e92bba80e9c9b7a719587815f115168a
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1397942
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397942 - Disable C5037 in xpcom/string to workaround MSVC bug. r=froydnj MozReview-Commit-ID: Gzx3gtt9eIF
xpcom/string/moz.build
--- a/xpcom/string/moz.build
+++ b/xpcom/string/moz.build
@@ -54,9 +54,16 @@ UNIFIED_SOURCES += [
 # Are we targeting x86 or x86-64?  If so, compile the SSE2 functions for
 # nsUTF8Utils.cpp and nsReadableUtils.cpp.
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['nsUTF8UtilsSSE2.cpp']
     SOURCES['nsUTF8UtilsSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
     SOURCES += ['nsReadableUtilsSSE2.cpp']
     SOURCES['nsReadableUtilsSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
+# MSVC 2017 has a bug that incorrectly generates C5037 warning which
+# hits the template string code. We need to disable this warning as a
+# workaround. See https://developercommunity.visualstudio.com/
+# content/problem/81223/incorrect-error-c5037-with-permissive.html
+if CONFIG['_MSC_VER']:
+    CXXFLAGS += ['-wd5037']
+
 FINAL_LIBRARY = 'xul'