Bug 1476486 - Apply clang warning suppression (rather than msvc) in pkix for clang-cl. r?Build draft
authorXidorn Quan <me@upsuper.org>
Thu, 19 Jul 2018 11:19:52 +1000
changeset 820169 cbe7cc4c53500744a0f782f0d30c387573697149
parent 820168 b7529731bd7bff337d503e0bd4f253f2b13c66c3
push id116737
push userxquan@mozilla.com
push dateThu, 19 Jul 2018 01:20:38 +0000
Bug 1476486 - Apply clang warning suppression (rather than msvc) in pkix for clang-cl. r?Build MozReview-Commit-ID: 6BCF6VYMI88
--- a/security/pkix/test/gtest/moz.build
+++ b/security/pkix/test/gtest/moz.build
@@ -40,29 +40,29 @@ include('../../warnings.mozbuild')
 # GTest uses a variadic macro in a questionable way and it doesn't seem to be
 # possible to selectively disable just that error when -pedantic-errors is set.
 if CONFIG['CC_TYPE'] == 'gcc':
 # These warnings are disabled in order to minimize the amount of boilerplate
 # required to implement tests, and/or because they originate in the GTest
 # framework in a way we cannot otherwise work around.
-if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
+if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
   CXXFLAGS += [
-  if CONFIG['CC_TYPE'] == 'clang':
+  if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
     CXXFLAGS += [
-elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
+elif CONFIG['CC_TYPE'] == 'msvc':
   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.
--- a/security/pkix/warnings.mozbuild
+++ b/security/pkix/warnings.mozbuild
@@ -1,21 +1,21 @@
-if CONFIG['CC_TYPE'] == 'clang':
+if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
   CXXFLAGS += [
     '-Wno-reserved-id-macro', # NSPR and NSS use reserved IDs in their include guards.
     '-Wno-weak-vtables', # We rely on the linker to merge the duplicate vtables.
-elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
+elif CONFIG['CC_TYPE'] == 'msvc':
   CXXFLAGS += [
     '-sdl', # Enable additional security checks based on Microsoft's SDL.
     '-wd4464', # relative include path contains '..'
     '-wd4514', # 'function': unreferenced inline function has been removed
     '-wd4668', # warning C4668: 'X' is not defined as a preprocessor macro,