]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sasl: fix `-Wunused-function` compiler warning
authorViktor Szakats <commit@vsz.me>
Wed, 15 Nov 2023 03:10:04 +0000 (03:10 +0000)
committerViktor Szakats <commit@vsz.me>
Wed, 15 Nov 2023 13:00:38 +0000 (13:00 +0000)
In builds with disabled auths.

```
lib/curl_sasl.c:266:17: warning: unused function 'get_server_message' [-Wunused-function]
static CURLcode get_server_message(struct SASL *sasl, struct Curl_easy *data,
                ^
1 warning generated.
```
Ref: https://github.com/curl/trurl/actions/runs/6871732122/job/18689066151#step:3:3822

Reviewed-by: Daniel Stenberg
Closes #12326

lib/curl_sasl.c

index 91ddf10622345fe66345359178278381dece5fe2..78ad298f20c0ffa056cb79fb7a2a31fb3def187b 100644 (file)
@@ -262,6 +262,8 @@ static void sasl_state(struct SASL *sasl, struct Curl_easy *data,
   sasl->state = newstate;
 }
 
+#if defined(USE_NTLM) || defined(USE_GSASL) || defined(USE_KERBEROS5) || \
+  !defined(CURL_DISABLE_DIGEST_AUTH)
 /* Get the SASL server message and convert it to binary. */
 static CURLcode get_server_message(struct SASL *sasl, struct Curl_easy *data,
                                    struct bufref *out)
@@ -284,6 +286,7 @@ static CURLcode get_server_message(struct SASL *sasl, struct Curl_easy *data,
   }
   return result;
 }
+#endif
 
 /* Encode the outgoing SASL message. */
 static CURLcode build_message(struct SASL *sasl, struct bufref *msg)