]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
HTTP: fix empty-body warning
authorEnno Boland <g@s01.de>
Fri, 3 Nov 2023 19:00:38 +0000 (20:00 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 5 Nov 2023 16:38:27 +0000 (17:38 +0100)
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

index 6d6498ca725da6ced87b8324ec529b9433b9be1b..d08d6cf01b0bcbc626eb3d95885f4454bbd5ec89 100644 (file)
@@ -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 */