Bug 1005309, Part 2: Enable extended compiler warnings (-W4 -Wall) in mozilla::pkix, r=mmc
authorBrian Smith <brian@briansmith.org>
Sat, 03 May 2014 17:50:26 -0700
changeset 201768 3c584aaabfb5b37d88bd8e21854b299baf3210d8
parent 201767 a939ec127378cf4f76ca73a9af295faff76c6500
child 201769 d572fe88d3eb7ae69a6f7da1f53af9678179cc42
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmmc
bugs1005309
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1005309, Part 2: Enable extended compiler warnings (-W4 -Wall) in mozilla::pkix, r=mmc
security/pkix/lib/pkixocsp.cpp
security/pkix/moz.build
--- a/security/pkix/lib/pkixocsp.cpp
+++ b/security/pkix/lib/pkixocsp.cpp
@@ -960,21 +960,21 @@ CreateEncodedOCSPRequest(PLArenaPool* ar
     cert->serialNumber.len);
 
   SECItem* encodedRequest = SECITEM_AllocItem(arena, nullptr, totalLen);
   if (!encodedRequest) {
     return nullptr;
   }
 
   uint8_t* d = encodedRequest->data;
-  *d++ = 0x30; *d++ = totalLen - 2;  // OCSPRequest (SEQUENCE)
-  *d++ = 0x30; *d++ = totalLen - 4;  //   tbsRequest (SEQUENCE)
-  *d++ = 0x30; *d++ = totalLen - 6;  //     requestList (SEQUENCE OF)
-  *d++ = 0x30; *d++ = totalLen - 8;  //       Request (SEQUENCE)
-  *d++ = 0x30; *d++ = totalLen - 10; //         reqCert (CertID SEQUENCE)
+  *d++ = 0x30; *d++ = totalLen - 2u;  // OCSPRequest (SEQUENCE)
+  *d++ = 0x30; *d++ = totalLen - 4u;  //   tbsRequest (SEQUENCE)
+  *d++ = 0x30; *d++ = totalLen - 6u;  //     requestList (SEQUENCE OF)
+  *d++ = 0x30; *d++ = totalLen - 8u;  //       Request (SEQUENCE)
+  *d++ = 0x30; *d++ = totalLen - 10u; //         reqCert (CertID SEQUENCE)
 
   // reqCert.hashAlgorithm
   for (size_t i = 0; i < PR_ARRAY_SIZE(hashAlgorithm); ++i) {
     *d++ = hashAlgorithm[i];
   }
 
   // reqCert.issuerNameHash (OCTET STRING)
   *d++ = 0x04;
--- a/security/pkix/moz.build
+++ b/security/pkix/moz.build
@@ -17,13 +17,24 @@ LOCAL_INCLUDES += [
     'include',
 ]
 
 TEST_DIRS += [
     'test/gtest',
     'test/lib',
 ]
 
+CXXFLAGS += ['-Wall']
+# -Wall with Visual C++ enables too many problematic warnings
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+  CXXFLAGS += [
+    '-wd4514', # 'function': unreferenced inline function has been removed
+    '-wd4668', # 'symbol' is not defined as a preprocessor macro...
+    '-wd4710', # 'function': function not inlined
+    '-wd4711', # function 'function' selected for inline expansion
+    '-wd4820', # 'bytes' bytes padding added after construct 'member_name'
+  ]
+
 FAIL_ON_WARNINGS = True
 
 LIBRARY_NAME = 'mozillapkix'
 
 FINAL_LIBRARY = 'xul'