From e919848ead98bd3feb30c7d6b4e08a9fccd0b1f1 Mon Sep 17 00:00:00 2001 From: Sergey Markelov Date: Sun, 11 Jul 2021 14:06:38 -0700 Subject: [PATCH] build: fix compiler warnings when CURL_DISABLE_VERBOSE_STRINGS fix compiler warnings about unused variables and parameters when built with --disable-verbose. Closes https://github.com/curl/curl/pull/7377 --- lib/connect.c | 2 ++ lib/vauth/digest_sspi.c | 4 ++++ lib/vauth/krb5_sspi.c | 4 ++++ lib/vauth/ntlm_sspi.c | 3 +++ 4 files changed, 13 insertions(+) diff --git a/lib/connect.c b/lib/connect.c index 91d68e216..b8fde5580 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -1092,9 +1092,11 @@ static void nosigpipe(struct Curl_easy *data, int onoff = 1; if(setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&onoff, sizeof(onoff)) < 0) { +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) char buffer[STRERROR_LEN]; infof(data, "Could not set SO_NOSIGPIPE: %s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); +#endif } } #else diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index 53c4df08a..94f8f8c0d 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -197,7 +197,9 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data, status == SEC_I_COMPLETE_AND_CONTINUE) s_pSecFn->CompleteAuthToken(&credentials, &resp_desc); else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) char buffer[STRERROR_LEN]; +#endif s_pSecFn->FreeCredentialsHandle(&credentials); Curl_sspi_free_identity(p_identity); @@ -585,7 +587,9 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, status == SEC_I_COMPLETE_AND_CONTINUE) s_pSecFn->CompleteAuthToken(&credentials, &resp_desc); else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { +#if !defined(CURL_DISABLE_VERBOSE_STRINGS) char buffer[STRERROR_LEN]; +#endif s_pSecFn->FreeCredentialsHandle(&credentials); diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index 6899570f8..8f7a2b02d 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -270,6 +270,10 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, SECURITY_STATUS status; char *user_name; +#if defined(CURL_DISABLE_VERBOSE_STRINGS) + (void) data; +#endif + /* Ensure we have a valid challenge message */ if(!Curl_bufref_len(chlg)) { infof(data, "GSSAPI handshake failure (empty security message)"); diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index b078c8249..3e39dad31 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -253,6 +253,9 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, unsigned long attrs; TimeStamp expiry; /* For Windows 9x compatibility of SSPI calls */ +#if defined(CURL_DISABLE_VERBOSE_STRINGS) + (void) data; +#endif (void) passwdp; (void) userp;