Bug 1361750 - Disable various MSVC 2017 warnings in PSM to unbreak --enable-warnings-as-errors builds. r?keeler draft
authorCykesiopka <cykesiopka.bmo@gmail.com>
Fri, 05 May 2017 00:41:33 +0800
changeset 572727 63d18d750efda0c99d2bce225bfc8c658f6da77c
parent 572570 33b92d9c40562dab3d7b602368c75619f1d793f7
child 627108 2d68a30ad8707bae3ed813914fa6d2b61a0482af
push id57165
push usercykesiopka.bmo@gmail.com
push dateThu, 04 May 2017 16:43:09 +0000
reviewerskeeler
bugs1361750
milestone55.0a1
Bug 1361750 - Disable various MSVC 2017 warnings in PSM to unbreak --enable-warnings-as-errors builds. r?keeler MSVC 2017 headers aren't warning free at the -Wall level. Since PSM enables -Wall in some moz.build files, this breaks --enable-warnings-as-errors builds. As a temporary measure, disable enough warnings to get working builds. MozReview-Commit-ID: G0oUsAYYct2
security/certverifier/moz.build
security/pkix/warnings.mozbuild
--- a/security/certverifier/moz.build
+++ b/security/certverifier/moz.build
@@ -89,16 +89,27 @@ if CONFIG['_MSC_VER']:
     ]
 
     # MSVC 2015 triggers these
     CXXFLAGS += [
         '-wd4456', # declaration of 'rv' hides previous local declaration
         '-wd4458', # declaration of 'input' hides class member
     ]
 
+    # The following warnings are disabled because MSVC 2017 headers aren't
+    # warning free at the -Wall level.
+    CXXFLAGS += [
+        '-wd4061', # enumerator 'identifier' in switch of enum 'enumeration' is
+                   # not explicitly handled by a case label
+        '-wd4365', # 'action' : conversion from 'type_1' to 'type_2',
+                   # signed/unsigned mismatch
+        '-wd4774', # '<function>' : format string expected in argument
+                   # <position> is not a string literal
+    ]
+
     # 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
     ]
 
 if CONFIG['GNU_CXX']:
--- a/security/pkix/warnings.mozbuild
+++ b/security/pkix/warnings.mozbuild
@@ -21,16 +21,28 @@ elif CONFIG['_MSC_VER']:
     '-wd4514', # 'function': unreferenced inline function has been removed
     '-wd4668', # warning C4668: 'X' is not defined as a preprocessor macro,
                # replacing with '0' for '#if/#elif'.
     '-wd4710', # 'function': function not inlined
     '-wd4711', # function 'function' selected for inline expansion
     '-wd4800', # forcing value to bool 'true' or 'false'
     '-wd4820', # 'bytes' bytes padding added after construct 'member_name'
 
+    # The following warnings are disabled because MSVC 2017 headers aren't
+    # warning free at the -Wall level.
+    '-wd4365', # 'action' : conversion from 'type_1' to 'type_2',
+               # signed/unsigned mismatch
+    '-wd4619', # #pragma warning : there is no warning number 'number'
+    '-wd4623', # 'derived class' : default constructor was implicitly defined as
+               # deleted because a base class default constructor is
+               # inaccessible or deleted
+    '-wd4774', # '<function>' : format string expected in argument <position> is
+               # not a string literal
+    '-wd4987', # nonstandard extension used: 'throw (...)'
+
     # XXX: We cannot use /Za (Disable Microsoft Extensions) because windows.h
     # won't copmile with it.
     '-Zc:forScope', # Standard C++ rules for variable scope in for loops.
     '-Zc:inline', # Standard C++ rules requiring definition inline functions.
     '-Zc:rvalueCast', # Standard C++ rules for result of cast being an rvalue.
     '-Zc:strictStrings', # Standard C++ rule that string literals are const.
   ]
 else: