]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang
authorViktor Szakats <commit@vsz.me>
Fri, 24 Oct 2025 19:12:37 +0000 (21:12 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 24 Oct 2025 20:53:26 +0000 (22:53 +0200)
Not tested in default CI.

macOS / CM clang OpenSSL gsasl rtmp AppleIDN SecTrust +examples,
macOS / CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples:
```
lib/vquic/curl_ngtcp2.c:530:5: error: code will never be executed [-Werror,-Wunreachable-code]
  530 |     const ngtcp2_transport_params *rp;
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/18787154442/job/53608230871?pr=19225#step:11:183

Confirmed fixed via #19225
Closes #19226

lib/vquic/curl_ngtcp2.c

index 9478b8d0f38d6c9c061f91855259515d47f57dc6..36265b73716d9546fe5cdf4ef5a6c92f50cd5450 100644 (file)
@@ -526,6 +526,7 @@ static int cf_ngtcp2_handshake_completed(ngtcp2_conn *tconn, void *user_data)
 
   ctx->tls_vrfy_result = Curl_vquic_tls_verify_peer(&ctx->tls, cf,
                                                     data, &ctx->peer);
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
   if(Curl_trc_is_verbose(data)) {
     const ngtcp2_transport_params *rp;
     rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn);
@@ -537,6 +538,7 @@ static int cf_ngtcp2_handshake_completed(ngtcp2_conn *tconn, void *user_data)
                (curl_uint64_t)rp->max_udp_payload_size,
                (curl_uint64_t)rp->initial_max_data);
   }
+#endif
 
   /* In case of earlydata, where we simulate being connected, update
    * the handshake time when we really did connect */