Bug 1397942 - Disable C5037 in xpcom/string to workaround MSVC bug. r?glandium
MozReview-Commit-ID: Gzx3gtt9eIF
--- 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'