From: Enno Boland Date: Fri, 3 Nov 2023 19:00:38 +0000 (+0100) Subject: HTTP: fix empty-body warning X-Git-Tag: curl-8_5_0~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46878b9e3fd89fc1f2beff04d989129a2fe30731;p=thirdparty%2Fcurl.git 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 --- 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 */