Bug 1397942 - Disable C5037 in xpcom/string to workaround MSVC bug. r?glandium draft
authorXidorn Quan <me@upsuper.org>
Fri, 08 Sep 2017 15:08:39 +1000
changeset 661187 28b583b88d4179c8549fb5c12879b3be869164c2
parent 661185 ef29c98bb0f561b79634d42f994d7870112de284
child 730487 8254b5027e24520092ad3f2d0065dcb1afc57f10
push id78668
push userxquan@mozilla.com
push dateFri, 08 Sep 2017 05:11:17 +0000
reviewersglandium
bugs1397942
milestone57.0a1
Bug 1397942 - Disable C5037 in xpcom/string to workaround MSVC bug. r?glandium 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'