Browse Source

Cleanup warnings for Cocoapods

Rob Napier 6 years ago
parent
commit
c73a0aac13
5 changed files with 14 additions and 3 deletions
  1. 1 0
      .swift-version
  2. 4 0
      Changelog.md
  3. 1 1
      RNCryptor-objc.podspec
  4. 2 2
      RNCryptor.xcodeproj/project.pbxproj
  5. 6 0
      RNCryptor/RNCryptor.m

+ 1 - 0
.swift-version

@@ -0,0 +1 @@
+3.0

+ 4 - 0
Changelog.md

@@ -1,3 +1,7 @@
+# Version 3.0.5
+
+# Clean up warnings for CocoaPods
+
 # Version 3.0.4
 
 * Remove non-modular header from framework header #11

+ 1 - 1
RNCryptor-objc.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name = 'RNCryptor-objc'
-  s.version = '3.0.4'
+  s.version = '3.0.5'
   s.summary = 'Encryptor/Decryptor for iOS.'
   s.authors = {'Rob Napier' => 'robnapier@gmail.com'}
   s.license = { 

+ 2 - 2
RNCryptor.xcodeproj/project.pbxproj

@@ -1199,7 +1199,7 @@
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
-				CLANG_WARN_UNREACHABLE_CODE = NO;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -1241,7 +1241,7 @@
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
-				CLANG_WARN_UNREACHABLE_CODE = NO;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;

+ 6 - 0
RNCryptor/RNCryptor.m

@@ -317,7 +317,10 @@ RN_CCKeyDerivationPBKDF( CCPBKDFAlgorithm algorithm, const char *password, size_
                CCPseudoRandomAlgorithm prf, uint rounds,
                uint8_t *derivedKey, size_t derivedKeyLen);
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunreachable-code"
   PBKDF = CCKeyDerivationPBKDF ?: RN_CCKeyDerivationPBKDF;
+#pragma clang diagnostic pop
 
   result = PBKDF(keySettings.PBKDFAlgorithm,         // algorithm
                  passwordData.bytes,                 // password
@@ -396,7 +399,10 @@ static int RN_SecRandomCopyBytes(void *rnd, size_t count, uint8_t *bytes) {
     result = SecRandomCopyBytes(NULL, length, data.mutableBytes);
   }
   else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunreachable-code"
     result = RN_SecRandomCopyBytes(NULL, length, data.mutableBytes);
+#pragma clang diagnostic pop
   }
   NSAssert(result == 0, @"Unable to generate random bytes: %d", errno);