Skip to content

Commit

Permalink
darwin: silence compiler warnings
Browse files Browse the repository at this point in the history
With a clang pragma and three type fixes

(this is cherry-picked from #1722 to see if the build works out fine)
  • Loading branch information
bagder committed Aug 2, 2017
1 parent a79ab93 commit 2cc28f6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/vtls/darwinssl.c
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -2846,3 +2850,5 @@ static ssize_t darwinssl_recv(struct connectdata *conn,
}

#endif /* USE_DARWINSSL */

#pragma clang diagnostic pop

0 comments on commit 2cc28f6

Please sign in to comment.