]> granicus.if.org Git - curl/commitdiff
darwin: silence compiler warnings
authorDaniel Stenberg <daniel@haxx.se>
Thu, 3 Aug 2017 22:04:39 +0000 (00:04 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 3 Aug 2017 22:07:02 +0000 (00:07 +0200)
With a clang pragma and three type fixes

Fixes #1722

lib/vtls/darwinssl.c

index 65378e3cbf106dae6f5eab7b3e3a18710613af20..20089dbe007d07f2a4b45b392ec266186ced6220 100644 (file)
 
 #ifdef USE_DARWINSSL
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
+#endif __clang__
+
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
@@ -2033,7 +2038,8 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data,
                                     const char *pinnedpubkey)
 {  /* Scratch */
   size_t pubkeylen, realpubkeylen, spkiHeaderLength = 24;
-  unsigned char *pubkey = NULL, *realpubkey = NULL, *spkiHeader = NULL;
+  unsigned char *pubkey = NULL, *realpubkey = NULL;
+  const unsigned char *spkiHeader = NULL;
   CFDataRef publicKeyBits = NULL;
 
   /* Result is returned to caller */
@@ -2076,7 +2082,7 @@ static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data,
 #endif /* DARWIN_SSL_PINNEDPUBKEY_V2 */
 
     pubkeylen = CFDataGetLength(publicKeyBits);
-    pubkey = CFDataGetBytePtr(publicKeyBits);
+    pubkey = (unsigned char *)CFDataGetBytePtr(publicKeyBits);
 
     switch(pubkeylen) {
       case 526:
@@ -2845,4 +2851,8 @@ static ssize_t darwinssl_recv(struct connectdata *conn,
   return (ssize_t)processed;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 #endif /* USE_DARWINSSL */