]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hostip: fix unreachable code in rare build configuration
authorViktor Szakats <commit@vsz.me>
Sun, 18 Jan 2026 06:19:47 +0000 (07:19 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 18 Jan 2026 11:45:39 +0000 (12:45 +0100)
with cmake options:
```
-DCMAKE_UNITY_BUILD=OFF -DCURL_DISABLE_HTTP=ON -DENABLE_THREADED_RESOLVER=OFF
```

Fixing (seen with Apple clang 17):
```
lib/hostip.c:939:16: error: code will never be executed [-Werror,-Wunreachable-code]
  940 |       *entry = dns;
      |                ^~~
```

Closes #20344

lib/hostip.c

index f88dfbd77f86a8cb38d43f12842c747953b46c43..2bb8638ef54b5e23c6850cdeca7d8fef21e50558 100644 (file)
@@ -935,10 +935,12 @@ out:
     return CURLE_OK;
   }
   else if(respwait) {
+#ifdef USE_CURL_ASYNC
     if(!Curl_resolv_check(data, &dns)) {
       *entry = dns;
       return dns ? CURLE_OK : CURLE_AGAIN;
     }
+#endif
     result = CURLE_COULDNT_RESOLVE_HOST;
   }
 error: