summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-08-02 13:55:39 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-08-02 13:55:39 +0200
commit38c90328aa892a8a5864b1432cc8c1dabb89afcf (patch)
treeaae06a71a0fdcbc62dc00f8ed942ec85696cfa26
parent0139545607ef56fdad11ef00dc1df05cdcbb763a (diff)
downloadcurl-bagder/darwinssl-warnings-pragma.tar.gz
darwin: silence compiler warningsbagder/darwinssl-warnings-pragma
With a clang pragma and three type fixes
-rw-r--r--lib/vtls/darwinssl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c
index b4b747ba4..c2200994f 100644
--- a/lib/vtls/darwinssl.c
+++ b/lib/vtls/darwinssl.c
@@ -32,6 +32,9 @@
#include "curl_base64.h"
#include "strtok.h"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
+
#ifdef USE_DARWINSSL
#ifdef HAVE_LIMITS_H
@@ -2033,7 +2036,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 +2080,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:
@@ -2846,3 +2850,5 @@ static ssize_t darwinssl_recv(struct connectdata *conn,
}
#endif /* USE_DARWINSSL */
+
+#pragma clang diagnostic pop