Bug 1256484 - Disable C4456 and C4458 to unblock compilation on VS2015; r?keeler draft
authorGregory Szorc <gps@mozilla.com>
Mon, 14 Mar 2016 23:57:33 -0700
changeset 340375 3e3530bcdc2ecd40084936673319959e427a0866
parent 340258 000b957d08f29701acea6aa48ad18a5aefc96a2c
child 516179 51faa2719df39f64c04dac9a17e019a69c3f6eaa
push id12955
push usergszorc@mozilla.com
push dateTue, 15 Mar 2016 06:58:46 +0000
reviewerskeeler
bugs1256484
milestone48.0a1
Bug 1256484 - Disable C4456 and C4458 to unblock compilation on VS2015; r?keeler 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 someone fixes the underlying problem someday. However, there are tons of ignored warnings in security/certverifier, so I guess the workaround in this patch is par for the course. MozReview-Commit-ID: 7GZ9RpkxnwT
security/certverifier/moz.build
security/pkix/moz.build
security/pkix/test/gtest/moz.build
--- a/security/certverifier/moz.build
+++ b/security/certverifier/moz.build
@@ -60,16 +60,22 @@ if CONFIG['_MSC_VER']:
 
   # MSVC 2010's headers trigger these
   CXXFLAGS += [
       '-wd4548', # expression before comma has no effect; ...
       '-wd4668', # 'symbol' is not defined as a preprocessor macro...
       '-wd4987', # nonstandard extension used
   ]
 
+  # MSVC 2015 triggers these
+  CXXFLAGS += [
+      '-wd4456', # declaration of 'rv' hides previous local declaration
+      '-wd4458', # declaration of 'input' hides class member
+  ]
+
   # Gecko headers aren't warning-free enough for us to enable these warnings
   CXXFLAGS += [
     '-wd4100', # 'symbol' : unreferenced formal parameter
     '-wd4127', # conditional expression is constant
     '-wd4946', # reinterpret_cast used between related types
   ]
 
 FINAL_LIBRARY = 'xul'
--- a/security/pkix/moz.build
+++ b/security/pkix/moz.build
@@ -26,8 +26,13 @@ TEST_DIRS += [
     'test/lib',
 ]
 
 include('warnings.mozbuild')
 
 Library('mozillapkix')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['_MSC_VER']:
+    # This is intended as a temporary hack to support building with VS2015.
+    # declaration of '*' hides class member
+    CXXFLAGS += ['-wd4458']
\ No newline at end of file
--- a/security/pkix/test/gtest/moz.build
+++ b/security/pkix/test/gtest/moz.build
@@ -49,9 +49,13 @@ if CONFIG['CLANG_CXX']:
 elif CONFIG['_MSC_VER']:
   CXXFLAGS += [
     '-wd4350', # behavior change: 'std::_Wrap_alloc<std::allocator<_Ty>>::...
     '-wd4275', # non dll-interface class used as base for dll-interface class
     '-wd4548', # Expression before comma has no effect
     '-wd4625', # copy constructor could not be generated.
     '-wd4626', # assugment operator could not be generated.
     '-wd4640', # construction of local static object is not thread safe.
+
+    # This is intended as a temporary hack to support building with VS2015.
+    # declaration of '*' hides class member
+    '-wd4458',
   ]