From 46878b9e3fd89fc1f2beff04d989129a2fe30731 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Fri, 3 Nov 2023 20:00:38 +0100 Subject: [PATCH] HTTP: fix empty-body warning This change fixes a compiler warning with gcc-12.2.0 when `-DCURL_DISABLE_BEARER_AUTH=ON` is used. /home/tox/src/curl/lib/http.c: In function 'Curl_http_input_auth': /home/tox/src/curl/lib/http.c:1147:12: warning: suggest braces around empty body in an 'else' statement [-Wempty-body] 1147 | ; | ^ Closes #12262 --- lib/http.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index 6d6498ca72..d08d6cf01b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1144,7 +1144,14 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, } } #else - ; + { + /* + * Empty block to terminate the if-else chain correctly. + * + * A semicolon would yield the same result here, but can cause a + * compiler warning when -Wextra is enabled. + */ + } #endif /* there may be multiple methods on one line, so keep reading */