]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: fix `-Wformat-signedness` by adjusting printf masks
authorViktor Szakats <commit@vsz.me>
Thu, 16 Apr 2026 01:16:20 +0000 (03:16 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 16 Apr 2026 08:32:50 +0000 (10:32 +0200)
- sync printf masks with the passed value.
- fix a couple of casts.

Cherry-picked from #20848

Closes #21335

56 files changed:
lib/altsvc.c
lib/cf-h2-proxy.c
lib/cf-https-connect.c
lib/cf-ip-happy.c
lib/content_encoding.c
lib/cw-out.c
lib/ftp.c
lib/http.c
lib/http2.c
lib/imap.c
lib/mime.c
lib/multi.c
lib/multi_ev.c
lib/rtsp.c
lib/smtp.c
lib/socks.c
lib/tftp.c
lib/url.c
lib/vquic/curl_ngtcp2.c
lib/vquic/curl_quiche.c
lib/vtls/gtls.c
lib/vtls/mbedtls.c
lib/vtls/openssl.c
lib/vtls/rustls.c
lib/vtls/schannel.c
lib/vtls/schannel_verify.c
lib/vtls/vtls.c
lib/vtls/vtls_scache.c
lib/vtls/x509asn1.c
lib/ws.c
src/config2setopts.c
src/tool_getparam.c
src/tool_writeout.c
src/var.c
tests/libtest/cli_h2_upgrade_extreme.c
tests/libtest/cli_ws_data.c
tests/libtest/cli_ws_pingpong.c
tests/libtest/first.c
tests/libtest/lib1560.c
tests/libtest/lib1565.c
tests/libtest/lib1597.c
tests/libtest/lib1947.c
tests/libtest/lib2405.c
tests/server/mqttd.c
tests/server/sws.c
tests/server/util.c
tests/tunit/tool1621.c
tests/unit/unit1323.c
tests/unit/unit1652.c
tests/unit/unit1660.c
tests/unit/unit1664.c
tests/unit/unit1675.c
tests/unit/unit2603.c
tests/unit/unit2604.c
tests/unit/unit2605.c
tests/unit/unit3200.c

index e0834cb66357a0ce1403426bba9675358eff5548..81b5379ad42c2e4b022e094c11669fa5a1a7facd 100644 (file)
@@ -294,7 +294,7 @@ static CURLcode altsvc_out(struct altsvc *as, FILE *fp)
                 "%s %s%s%s %u "
                 "\"%d%02d%02d "
                 "%02d:%02d:%02d\" "
-                "%u 0\n", /* prio still always zero */
+                "%d 0\n", /* prio still always zero */
                 Curl_alpnid2str(as->src.alpnid),
                 src6_pre, as->src.host, src6_post,
                 as->src.port,
index 4dd4f4ab35b751c0183791a7eed950f8c18c29a5..2f8cc41dd52b07cf27d5e93d5df9576257825ba4 100644 (file)
@@ -627,7 +627,7 @@ static ssize_t tunnel_send_callback(nghttp2_session *session,
   if(ts->closed && Curl_bufq_is_empty(&ts->sendbuf))
     *data_flags = NGHTTP2_DATA_FLAG_EOF;
 
-  CURL_TRC_CF(data, cf, "[%d] tunnel_send_callback -> %zd",
+  CURL_TRC_CF(data, cf, "[%d] tunnel_send_callback -> %zu",
               ts->stream_id, nread);
   return (nread  > SSIZE_MAX) ?
     NGHTTP2_ERR_CALLBACK_FAILURE : (ssize_t)nread;
@@ -675,7 +675,7 @@ static int proxy_h2_on_stream_close(nghttp2_session *session,
   if(stream_id != ctx->tunnel.stream_id)
     return 0;
 
-  CURL_TRC_CF(data, cf, "[%d] proxy_h2_on_stream_close, %s (err %d)",
+  CURL_TRC_CF(data, cf, "[%d] proxy_h2_on_stream_close, %s (err %u)",
               stream_id, nghttp2_http2_strerror(error_code), error_code);
   ctx->tunnel.closed = TRUE;
   ctx->tunnel.error = error_code;
@@ -1159,7 +1159,7 @@ static CURLcode h2_handle_tunnel_close(struct Curl_cfilter *cf,
 
   *pnread = 0;
   if(ctx->tunnel.error) {
-    failf(data, "HTTP/2 stream %u reset by %s (error 0x%x %s)",
+    failf(data, "HTTP/2 stream %d reset by %s (error 0x%x %s)",
           ctx->tunnel.stream_id, ctx->tunnel.reset ? "server" : "curl",
           ctx->tunnel.error, nghttp2_http2_strerror(ctx->tunnel.error));
     return CURLE_RECV_ERROR;
@@ -1269,7 +1269,7 @@ static CURLcode cf_h2_proxy_send(struct Curl_cfilter *cf,
   }
 
   result = Curl_bufq_write(&ctx->tunnel.sendbuf, buf, len, pnwritten);
-  CURL_TRC_CF(data, cf, "cf_send(), bufq_write %d, %zd", result, *pnwritten);
+  CURL_TRC_CF(data, cf, "cf_send(), bufq_write %d, %zu", result, *pnwritten);
   if(result && (result != CURLE_AGAIN))
     goto out;
 
index 5434cd7ed63b0a49f9718b1e1b12ef0a49dc4c50..00a5882370a9b6ec4bf0b0aff9f23324958ff915 100644 (file)
@@ -625,7 +625,7 @@ static CURLcode cf_hc_adjust_pollset(struct Curl_cfilter *cf,
         continue;
       result = Curl_conn_cf_adjust_pollset(b->cf, data, ps);
     }
-    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %d socks", result, ps->n);
+    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", result, ps->n);
   }
   return result;
 }
index 5979fc55488df8842c3fefc2f70df75bcb4f079d..f246fb8e16687999335a9a0a807dd02f8e0dadd9 100644 (file)
@@ -403,7 +403,7 @@ evaluate:
   }
   if(bs->running)
     CURL_TRC_CF(data, cf, "checked connect attempts: "
-                "%d ongoing, %d inconclusive", ongoing, inconclusive);
+                "%u ongoing, %u inconclusive", ongoing, inconclusive);
 
   /* no attempt connected yet, start another one? */
   if(!ongoing) {
@@ -700,7 +700,7 @@ static CURLcode is_connected(struct Curl_cfilter *cf,
         port = conn->conn_to_port;
       else
         port = conn->remote_port;
-      curl_msnprintf(viamsg, sizeof(viamsg), "port %u", port);
+      curl_msnprintf(viamsg, sizeof(viamsg), "port %d", port);
     }
 
     failf(data, "Failed to connect to %s %s %s%s%safter "
@@ -786,7 +786,7 @@ static CURLcode cf_ip_happy_adjust_pollset(struct Curl_cfilter *cf,
 
   if(!cf->connected) {
     result = cf_ip_ballers_pollset(&ctx->ballers, data, ps);
-    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %d socks", result, ps->n);
+    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", result, ps->n);
   }
   return result;
 }
index 32d32241f4ea83b237de00524f9aa3aa715f2667..0224a8bfe9e8d4f013b398c1dfafda4c677de223 100644 (file)
@@ -751,7 +751,7 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
       }
 
       if(Curl_cwriter_count(data, phase) + 1 >= MAX_ENCODE_STACK) {
-        failf(data, "Reject response due to more than %u content encodings",
+        failf(data, "Reject response due to more than %d content encodings",
               MAX_ENCODE_STACK);
         return CURLE_BAD_CONTENT_ENCODING;
       }
index f841725e46f8c1426dbe27e67933baeac1faf66b..2af074e5871cf5f30e2c05e0c7b1caeecd340c96 100644 (file)
@@ -211,7 +211,7 @@ static CURLcode cw_out_cb_write(struct cw_out_ctx *ctx,
   }
   else if(nwritten != blen) {
     failf(data, "Failure writing output to destination, "
-          "passed %zu returned %zd", blen, nwritten);
+          "passed %zu returned %zu", blen, nwritten);
     return CURLE_WRITE_ERROR;
   }
   *pnwritten = nwritten;
index 14839eeb504d2151a628f91cb75aa413def9f930..9d3700df5f7b70fab684b792edfbff5fed2ac7f6 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -732,7 +732,7 @@ static CURLcode getftpresponse(struct Curl_easy *data,
   } /* while there is buffer left and loop is requested */
 
   pp->pending_resp = FALSE;
-  CURL_TRC_FTP(data, "getftpresponse -> result=%d, nread=%zd, ftpcode=%d",
+  CURL_TRC_FTP(data, "getftpresponse -> result=%d, nread=%zu, ftpcode=%d",
                result, *nreadp, *ftpcodep);
 
   return result;
index 0f826f05968b187c2e467e00d238088260f3c7c6..34fa807d8d5769e8d36db963b86c6b101a5d6f8f 100644 (file)
@@ -1256,7 +1256,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
         curlx_free(portnum);
       }
       if(port != data->info.conn_remote_port) {
-        infof(data, "Clear auth, redirects to port from %u to %u",
+        infof(data, "Clear auth, redirects to port from %d to %d",
               data->info.conn_remote_port, port);
         clear = TRUE;
       }
@@ -3761,13 +3761,13 @@ static CURLcode http_statusline(struct Curl_easy *data,
     /* no major version switch mid-connection */
     if(k->httpversion_sent &&
        (k->httpversion / 10 != k->httpversion_sent / 10)) {
-      failf(data, "Version mismatch (from HTTP/%u to HTTP/%u)",
+      failf(data, "Version mismatch (from HTTP/%d to HTTP/%d)",
             k->httpversion_sent / 10, k->httpversion / 10);
       return CURLE_WEIRD_SERVER_REPLY;
     }
     break;
   default:
-    failf(data, "Unsupported HTTP version (%u.%d) in response",
+    failf(data, "Unsupported HTTP version (%d.%d) in response",
           k->httpversion / 10, k->httpversion % 10);
     return CURLE_UNSUPPORTED_PROTOCOL;
   }
index 54044bcb9dabe3e403f6163a1c8e6237422048ab..7b1bab5ca8d7e7a078ba4624f0e55afa6574f468 100644 (file)
@@ -877,7 +877,7 @@ static int push_promise(struct Curl_cfilter *cf,
                                               newstream->id,
                                               newhandle);
     if(rv) {
-      infof(data, "failed to set user_data for stream %u",
+      infof(data, "failed to set user_data for stream %d",
             newstream->id);
       DEBUGASSERT(0);
       discard_newhandle(cf, newhandle);
@@ -1113,7 +1113,7 @@ int Curl_nghttp2_fr_print(const nghttp2_frame *frame, char *buffer,
       memcpy(scratch, frame->goaway.opaque_data, len);
     scratch[len] = '\0';
     return curl_msnprintf(buffer, blen,
-                          "FRAME[GOAWAY, error=%d, reason='%s', "
+                          "FRAME[GOAWAY, error=%u, reason='%s', "
                           "last_stream=%d]", frame->goaway.error_code,
                           scratch, frame->goaway.last_stream_id);
   }
@@ -1148,7 +1148,7 @@ static int on_frame_send(nghttp2_session *session, const nghttp2_frame *frame,
   if((frame->hd.type == NGHTTP2_GOAWAY) && !ctx->sent_goaway) {
     /* A GOAWAY not initiated by us, but by nghttp2 itself on detecting
      * a protocol error on the connection */
-    failf(data, "nghttp2 shuts down connection with error %d: %s",
+    failf(data, "nghttp2 shuts down connection with error %u: %s",
           frame->goaway.error_code,
           nghttp2_http2_strerror(frame->goaway.error_code));
   }
@@ -1186,7 +1186,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
           session, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS);
         ctx->enable_push = nghttp2_session_get_remote_settings(
           session, NGHTTP2_SETTINGS_ENABLE_PUSH) != 0;
-        CURL_TRC_CF(data, cf, "[0] MAX_CONCURRENT_STREAMS: %d",
+        CURL_TRC_CF(data, cf, "[0] MAX_CONCURRENT_STREAMS: %u",
                     ctx->max_concurrent_streams);
         CURL_TRC_CF(data, cf, "[0] ENABLE_PUSH: %s",
                     ctx->enable_push ? "TRUE" : "false");
@@ -1211,7 +1211,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
       ctx->goaway_error = frame->goaway.error_code;
       ctx->remote_max_sid = frame->goaway.last_stream_id;
       if(data) {
-        infof(data, "received GOAWAY, error=%u, last_stream=%u",
+        infof(data, "received GOAWAY, error=%u, last_stream=%d",
               ctx->goaway_error, ctx->remote_max_sid);
         Curl_multi_connchanged(data->multi);
       }
@@ -1341,7 +1341,7 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
     stream->reset = TRUE;
 
   if(stream->error)
-    CURL_TRC_CF(data_s, cf, "[%d] RESET: %s (err %d)",
+    CURL_TRC_CF(data_s, cf, "[%d] RESET: %s (err %u)",
               stream_id, nghttp2_http2_strerror(error_code), error_code);
   else
     CURL_TRC_CF(data_s, cf, "[%d] CLOSED", stream_id);
@@ -1350,7 +1350,7 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
   /* remove `data_s` from the nghttp2 stream */
   rv = nghttp2_session_set_stream_user_data(session, stream_id, 0);
   if(rv) {
-    infof(data_s, "http/2: failed to clear user_data for stream %u",
+    infof(data_s, "http/2: failed to clear user_data for stream %d",
           stream_id);
     DEBUGASSERT(0);
   }
@@ -1522,7 +1522,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
       cf_h2_header_error(cf, data_s, stream, result);
       return NGHTTP2_ERR_CALLBACK_FAILURE;
     }
-    hlen = curl_msnprintf(buffer, sizeof(buffer), HTTP_PSEUDO_STATUS ":%u\r",
+    hlen = curl_msnprintf(buffer, sizeof(buffer), HTTP_PSEUDO_STATUS ":%d\r",
                           stream->status_code);
     result = Curl_headers_push(data_s, buffer, hlen, CURLH_PSEUDO);
     if(result) {
@@ -1709,7 +1709,7 @@ static CURLcode http2_handle_stream_close(struct Curl_cfilter *cf,
         stream->close_handled = TRUE;
         return CURLE_OK;
     }
-    failf(data, "HTTP/2 stream %u reset by %s (error 0x%x %s)",
+    failf(data, "HTTP/2 stream %d reset by %s (error 0x%x %s)",
           stream->id, stream->reset_by_server ? "server" : "curl",
           stream->error, nghttp2_http2_strerror(stream->error));
     return stream->error ? CURLE_HTTP2_STREAM :
@@ -2053,7 +2053,7 @@ static CURLcode cf_h2_body_send(struct Curl_cfilter *cf,
       return CURLE_OK;
     }
     /* Server closed before we got a response, this is an error */
-    infof(data, "stream %u closed", stream->id);
+    infof(data, "stream %d closed", stream->id);
     return CURLE_SEND_ERROR;
   }
 
@@ -2153,7 +2153,7 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream,
   }
 
   if(stream_id < 0) {
-    CURL_TRC_CF(data, cf, "send: nghttp2_submit_request error (%s)%u",
+    CURL_TRC_CF(data, cf, "send: nghttp2_submit_request error (%s)%d",
                 nghttp2_strerror(stream_id), stream_id);
     result = CURLE_SEND_ERROR;
     goto out;
@@ -2253,7 +2253,7 @@ static CURLcode cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data,
   /* if the stream has been closed in egress handling (nghttp2 does that
    * when it does not like the headers, for example */
   if(stream && stream->closed) {
-    infof(data, "stream %u closed", stream->id);
+    infof(data, "stream %d closed", stream->id);
     result = CURLE_SEND_ERROR;
     goto out;
   }
@@ -2462,7 +2462,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf,
     rc = nghttp2_session_set_stream_user_data(ctx->h2, stream->id,
                                               data);
     if(rc) {
-      infof(data, "http/2: failed to set user_data for stream %u",
+      infof(data, "http/2: failed to set user_data for stream %d",
             stream->id);
       DEBUGASSERT(0);
     }
index ccfbeb72c4231ea1ab4bff9d107b8b6c2f3fa329..5ef2a2cb218901433e321ce49cd2e5dfa4c23bd7 100644 (file)
@@ -1452,8 +1452,8 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data,
       if(result)
         return result;
 
-      infof(data, "Written %zu bytes, %" FMT_OFF_TU
-            " bytes are left for transfer", chunk, size - chunk);
+      infof(data, "Written %zu bytes, %" FMT_OFF_T
+            " bytes are left for transfer", chunk, (curl_off_t)(size - chunk));
 
       /* Have we used the entire overflow or part of it?*/
       if(pp->overflow > chunk) {
index 157884a83836343a68c80e7ad1386166eac7548f..e987d0b30ee97ce5806479974ab230727acc2e87 100644 (file)
@@ -1930,7 +1930,7 @@ static CURLcode cr_mime_read(struct Curl_easy *data,
   else
     nread = Curl_mime_read(buf, 1, blen, ctx->part);
 
-  CURL_TRC_READ(data, "cr_mime_read(len=%zu), mime_read() -> %zd",
+  CURL_TRC_READ(data, "cr_mime_read(len=%zu), mime_read() -> %zu",
                 blen, nread);
 
   switch(nread) {
index b659ac7490d90c7117f616f6307821ea1152443e..f3fd7938fbe0bf7aaccfe66cd297216be40e3331 100644 (file)
@@ -1622,7 +1622,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi,
     timeout_ms = (int)timeout_internal;
 
   if(data)
-    CURL_TRC_M(data, "multi_wait(fds=%d, timeout=%d) tinternal=%ld",
+    CURL_TRC_M(data, "multi_wait(fds=%u, timeout=%d) tinternal=%ld",
                cpfds.n, timeout_ms, timeout_internal);
 
 #ifdef USE_WINSOCK
index b98cda0c68d13a4c47f53763a4bba5df38da41bd..937e7ce48d32c0f05b4410c9c1e0ff4e76cdb250 100644 (file)
@@ -253,7 +253,7 @@ static CURLMcode mev_sh_entry_update(struct Curl_multi *multi,
   DEBUGASSERT(entry->writers + entry->readers);
 
   CURL_TRC_M(data, "ev update fd=%" FMT_SOCKET_T ", action '%s%s' -> '%s%s'"
-             " (%d/%d r/w)", s,
+             " (%u/%u r/w)", s,
              (last_action & CURL_POLL_IN) ? "IN" : "",
              (last_action & CURL_POLL_OUT) ? "OUT" : "",
              (cur_action & CURL_POLL_IN) ? "IN" : "",
index 285126371c55b3abda3746a1b441d379630d10dc..354a982c51f63197225d0e2b2939d54d17bb50b5 100644 (file)
@@ -674,7 +674,7 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data,
             /* This could be the next response, no consume and return */
             if(*pconsumed) {
               DEBUGF(infof(data, "RTP rtsp_filter_rtp[SKIP] RTSP/ prefix, "
-                           "skipping %zd bytes of junk", *pconsumed));
+                           "skipping %zu bytes of junk", *pconsumed));
             }
             rtspc->state = RTP_PARSE_SKIP;
             rtspc->in_header = TRUE;
index 86fc8831401c52697f1fad8f3577f28ad754da08..b5c425cd7c1860c11a157f15f0262b7b2cab9226 100644 (file)
@@ -431,7 +431,7 @@ static CURLcode cr_eob_read(struct Curl_easy *data,
     ctx->eos = TRUE;
   }
   *peos = (bool)ctx->eos;
-  DEBUGF(infof(data, "cr_eob_read(%zu) -> %d, %zd, %d",
+  DEBUGF(infof(data, "cr_eob_read(%zu) -> %d, %zu, %d",
                blen, result, *pnread, *peos));
   return result;
 }
index 8d1a4e9540ce7663cf2aa60a28d5a73e88f87e17..f09c751fe5e31b62f98288a43807587b027d2475 100644 (file)
@@ -1273,7 +1273,7 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf,
     struct ip_quadruple ipquad;
     bool is_ipv6;
     if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad))
-      infof(data, "Opened %sSOCKS connection from %s port %u to %s port %u "
+      infof(data, "Opened %sSOCKS connection from %s port %d to %s port %d "
             "(via %s port %u)",
             (sockindex == SECONDARYSOCKET) ? "2nd " : "",
             ipquad.local_ip, ipquad.local_port,
index dd006fb1cf258726c4e313d066897fc82169c01e..6cc672d447bf22cbfde7a0124d0935662fb8a958 100644 (file)
@@ -300,8 +300,8 @@ static CURLcode tftp_parse_option_ack(struct tftp_conn *state,
         return CURLE_TFTP_ILLEGAL;
       }
 
-      state->blksize = (int)blksize;
-      infof(data, "blksize parsed from OACK (%d) requested (%d)",
+      state->blksize = (unsigned int)blksize;
+      infof(data, "blksize parsed from OACK (%u) requested (%u)",
             state->blksize, state->requested_blksize);
     }
     else if(checkprefix(TFTP_OPTION_TSIZE, option)) {
@@ -717,7 +717,7 @@ static CURLcode tftp_send_first(struct tftp_conn *state,
         result = tftp_option_add(state, &sbytes, sbytes, buf);
 
       /* add blksize option */
-      curl_msnprintf(buf, sizeof(buf), "%d", state->requested_blksize);
+      curl_msnprintf(buf, sizeof(buf), "%u", state->requested_blksize);
       if(result == CURLE_OK)
         result = tftp_option_add(state, &sbytes, sbytes, TFTP_OPTION_BLKSIZE);
       if(result == CURLE_OK)
index 0f230101d94012b824fdf592637505deee0b6de4..61d29bdbd775ec0fcaaa18690d7325a8e9ace42e 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1815,7 +1815,7 @@ static CURLcode setup_connection_internals(struct Curl_easy *data,
   /* IPv6 addresses with a scope_id (0 is default == global) have a
    * printable representation with a '%<scope_id>' suffix. */
   if(conn->scope_id)
-    conn->destination = curl_maprintf("[%s:%u]%%%d", hostname, port,
+    conn->destination = curl_maprintf("[%s:%u]%%%u", hostname, port,
                                       conn->scope_id);
   else
 #endif
index 04c6ed1feef84d111513c7ce88f3026a8cbf16cf..8cf3886d224197f78e4a4f16038fa4f3778f57dc 100644 (file)
@@ -1141,7 +1141,7 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id,
   if(stream->rx_offset_max < stream->rx_offset)
     stream->rx_offset_max = stream->rx_offset;
 
-  CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu, rx win=%" PRId64,
+  CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu, rx win=%" PRIu64,
               stream->id, blen, stream->rx_offset_max - stream->rx_offset);
   cf_ngtcp2_upd_rx_win(cf, data, stream);
   return 0;
@@ -1587,7 +1587,7 @@ static nghttp3_ssize cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id,
   }
 
   CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> "
-              "%d vecs%s with %zu (buffered=%zu, left=%" FMT_OFF_T ")",
+              "%d vecs%s with %zd (buffered=%zu, left=%" FMT_OFF_T ")",
               stream->id, (int)nvecs,
               *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "",
               nwritten, Curl_bufq_len(&stream->sendbuf),
@@ -2244,8 +2244,8 @@ static CURLcode cf_ngtcp2_shutdown(struct Curl_cfilter *cf,
       (uint8_t *)buffer, sizeof(buffer),
       &ctx->last_error, pktx.ts);
     CURL_TRC_CF(data, cf, "start shutdown(err_type=%d, err_code=%"
-                PRIu64 ") -> %d", ctx->last_error.type,
-                ctx->last_error.error_code, (int)nwritten);
+                PRIu64 ") -> %zd", ctx->last_error.type,
+                ctx->last_error.error_code, (ssize_t)nwritten);
     /* there are cases listed in ngtcp2 documentation where this call
      * may fail. Since we are doing a connection shutdown as graceful
      * as we can, such an error is ignored here. */
@@ -2412,7 +2412,7 @@ static int quic_gtls_handshake_cb(gnutls_session_t session, unsigned int htype,
     DEBUGASSERT(data);
     if(!data)
       return 0;
-    CURL_TRC_CF(data, cf, "SSL message: %s %s [%d]",
+    CURL_TRC_CF(data, cf, "SSL message: %s %s [%u]",
                 incoming ? "<-" : "->", gtls_hs_msg_name(htype), htype);
     switch(htype) {
     case GNUTLS_HANDSHAKE_NEW_SESSION_TICKET: {
index 8a24e1f6a5384d92269f9fb4ed30430baa7d2318..73f664a65344bb11f0cdabd10703f4f145cf35e7 100644 (file)
@@ -1051,7 +1051,7 @@ static CURLcode h3_open_stream(struct Curl_cfilter *cf,
       goto out;
     }
     else {
-      CURL_TRC_CF(data, cf, "send_request(%s) -> %" PRIu64,
+      CURL_TRC_CF(data, cf, "send_request(%s) -> %" PRId64,
                   Curl_bufref_ptr(&data->state.url), rv);
     }
     result = CURLE_SEND_ERROR;
index 1b581cda88e50d5a2b54da0f3bf304f06bddaa2b..9b6a4fab2e3935a41f734df932e5271943b90f01 100644 (file)
@@ -127,7 +127,7 @@ static ssize_t gtls_pull(void *s, void *buf, size_t blen)
   }
 
   result = Curl_conn_cf_recv(cf->next, data, buf, blen, &nread);
-  CURL_TRC_CF(data, cf, "glts_pull(len=%zu) -> %d, %zd", blen, result, nread);
+  CURL_TRC_CF(data, cf, "glts_pull(len=%zu) -> %d, %zu", blen, result, nread);
   backend->gtls.io_result = result;
   if(result) {
     /* !checksrc! disable ERRNOVAR 1 */
@@ -793,7 +793,7 @@ static int gtls_handshake_cb(gnutls_session_t session, unsigned int htype,
   if(when) { /* after message has been processed */
     struct Curl_easy *data = CF_DATA_CURRENT(cf);
     if(data) {
-      CURL_TRC_CF(data, cf, "handshake: %s message type %d",
+      CURL_TRC_CF(data, cf, "handshake: %s message type %u",
                   incoming ? "incoming" : "outgoing", htype);
       switch(htype) {
       case GNUTLS_HANDSHAKE_NEW_SESSION_TICKET: {
@@ -1619,7 +1619,7 @@ CURLcode Curl_gtls_verifyserver(struct Curl_cfilter *cf,
 
   if(data->set.ssl.certinfo && chain.certs) {
     if(chain.num_certs > MAX_ALLOWED_CERT_AMOUNT) {
-      failf(data, "%u certificates is more than allowed (%u)",
+      failf(data, "%u certificates is more than allowed (%d)",
             chain.num_certs, MAX_ALLOWED_CERT_AMOUNT);
       result = CURLE_SSL_CONNECT_ERROR;
       goto out;
index 1cac66041d0c0e9404259eace776493c812fc4fa..b4c58afa88462821da2a5ed83f9d7601e1deca9d 100644 (file)
@@ -425,7 +425,7 @@ static void mbed_extract_certinfo(struct Curl_easy *data,
     cert_count++;
 
   if(cert_count > MAX_ALLOWED_CERT_AMOUNT) {
-    infof(data, "Certificates is more than allowed (%u), skipping certinfo",
+    infof(data, "Certificates is more than allowed (%d), skipping certinfo",
           MAX_ALLOWED_CERT_AMOUNT);
     return;
   }
index 71f792962d711a93a147b5ffb5588b01b13fbf49..cefdbd5b61c5ac207a2be8306f9a2814e450fa11 100644 (file)
@@ -279,7 +279,7 @@ static CURLcode get_pkey_rsa(struct Curl_easy *data,
 #else
   RSA_get0_key(rsa, &n, &e, NULL);
 #endif /* HAVE_EVP_PKEY_GET_PARAMS */
-  BIO_printf(mem, "%d", n ? BN_num_bits(n) : 0);
+  BIO_printf(mem, "%d", (int)(n ? BN_num_bits(n) : 0));
   result = push_certinfo(data, mem, "RSA Public Key", i);
   if(!result) {
     result = print_pubkey_BN(rsa, n, i);
@@ -384,7 +384,7 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl)
 
   numcerts = sk_X509_num(sk);
   if(numcerts > MAX_ALLOWED_CERT_AMOUNT) {
-    failf(data, "%d certificates is more than allowed (%u)", (int)numcerts,
+    failf(data, "%d certificates is more than allowed (%d)", (int)numcerts,
           MAX_ALLOWED_CERT_AMOUNT);
     return CURLE_SSL_CONNECT_ERROR;
   }
index fcd4f7289e8ff44f05fbb8c8b4c2dc17f9ecda9c..d886c850520761c3a1a9a01ea1cb224efc25e1eb 100644 (file)
@@ -373,7 +373,7 @@ static CURLcode cr_send(struct Curl_cfilter *cf, struct Curl_easy *data,
     *pnwritten += (ssize_t)plainwritten;
 
 out:
-  CURL_TRC_CF(data, cf, "rustls_send(len=%zu) -> %d, %zd",
+  CURL_TRC_CF(data, cf, "rustls_send(len=%zu) -> %d, %zu",
               plainlen, result, *pnwritten);
   return result;
 }
@@ -1217,7 +1217,7 @@ static CURLcode cr_connect(struct Curl_cfilter *cf, struct Curl_easy *data,
         while(rustls_connection_get_peer_certificate(rconn, num_certs)) {
           num_certs++;
           if(num_certs > MAX_ALLOWED_CERT_AMOUNT) {
-            failf(data, "%zu certificates is more than allowed (%u)",
+            failf(data, "%zu certificates is more than allowed (%d)",
                   num_certs, MAX_ALLOWED_CERT_AMOUNT);
             return CURLE_SSL_CONNECT_ERROR;
           }
index 05bd6a5194d712d2e7ffa2a374fe835b3cf27b60..fb5ff0e9d8e63bb459c9638dfbdfaa26828bd1ae 100644 (file)
@@ -1670,7 +1670,7 @@ static CURLcode schannel_connect_step3(struct Curl_cfilter *cf,
 
     traverse_cert_store(ccert_context, cert_counter_callback, &certs_count);
     if(certs_count > MAX_ALLOWED_CERT_AMOUNT) {
-      failf(data, "%d certificates is more than allowed (%u)",
+      failf(data, "%d certificates is more than allowed (%d)",
             certs_count, MAX_ALLOWED_CERT_AMOUNT);
       CertFreeCertificateContext(ccert_context);
       return CURLE_SSL_CONNECT_ERROR;
index 3e0130c8e9efd1b94da79bd2c3a2585397007adf..9be6fe311ccdbcfe7598c6a2392234a397551df0 100644 (file)
@@ -290,7 +290,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store,
   }
 
   if(file_size.QuadPart > MAX_CAFILE_SIZE) {
-    failf(data, "schannel: CA file exceeds max size of %u bytes",
+    failf(data, "schannel: CA file exceeds max size of %d bytes",
           MAX_CAFILE_SIZE);
     result = CURLE_SSL_CACERT_BADFILE;
     goto cleanup;
index bed3a13ec8bf2fba1ddcd1bb853170470d806fae..9287c61484a832dddcbf7b09d9db15eba6b7d028 100644 (file)
@@ -1393,7 +1393,7 @@ static CURLcode ssl_cf_set_earlydata(struct Curl_cfilter *cf,
     if(blen > connssl->earlydata_max)
       blen = connssl->earlydata_max;
     result = Curl_bufq_write(&connssl->earlydata, buf, blen, &nwritten);
-    CURL_TRC_CF(data, cf, "ssl_cf_set_earlydata(len=%zu) -> %zd",
+    CURL_TRC_CF(data, cf, "ssl_cf_set_earlydata(len=%zu) -> %zu",
                 blen, nwritten);
     if(result)
       return result;
index 3977046168b8452b6681c4ab324f07f82c9167be..12b7ea908fa7919e79078f3d298f7eefb7220665 100644 (file)
@@ -200,7 +200,7 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf,
   }
 
   if(ssl->version || ssl->version_max) {
-    r = curlx_dyn_addf(&buf, ":TLSVER-%d-%d", ssl->version,
+    r = curlx_dyn_addf(&buf, ":TLSVER-%d-%u", ssl->version,
                        (ssl->version_max >> 16));
     if(r)
       goto out;
index 5a394ef9f292ef3272f4ba25f9939613e081be09..788dfb278ade403544d30d601c797364541d058f 100644 (file)
@@ -607,7 +607,7 @@ static CURLcode UTime2str(struct dynbuf *store,
   }
 
   tzl = end - tzp;
-  return curlx_dyn_addf(store, "%u%.2s-%.2s-%.2s %.2s:%.2s:%.2s %.*s",
+  return curlx_dyn_addf(store, "%d%.2s-%.2s-%.2s %.2s:%.2s:%.2s %.*s",
                         20 - (*beg >= '5'), beg, beg + 2, beg + 4,
                         beg + 6, beg + 8, sec,
                         (int)tzl, tzp);
index e3b8f6ce9bb4d245a75a8c423494b808beec4459..5cf1f248412b4f1ec0f84ec3b78c427839f6484c 100644 (file)
--- a/lib/ws.c
+++ b/lib/ws.c
@@ -758,7 +758,7 @@ static CURLcode ws_cw_write(struct Curl_easy *data,
   }
 
   if((type & CLIENTWRITE_EOS) && !Curl_bufq_is_empty(&ctx->buf)) {
-    failf(data, "[WS] decode ending with %zd frame bytes remaining",
+    failf(data, "[WS] decode ending with %zu frame bytes remaining",
           Curl_bufq_len(&ctx->buf));
     return CURLE_RECV_ERROR;
   }
@@ -1049,9 +1049,9 @@ static CURLcode ws_enc_send(struct Curl_easy *data,
     if((curl_off_t)buflen >
        (ws->enc.payload_remain + (curl_off_t)ws->sendbuf_payload)) {
       /* too large buflen beyond payload length of frame */
-      failf(data, "[WS] unaligned frame size (sending %zu instead of %"
-                  FMT_OFF_T ")",
-            buflen, ws->enc.payload_remain + ws->sendbuf_payload);
+      failf(data, "[WS] unaligned frame size (sending %zu instead of "
+            "%" FMT_OFF_T ")", buflen,
+            (curl_off_t)(ws->enc.payload_remain + ws->sendbuf_payload));
       return CURLE_BAD_FUNCTION_ARGUMENT;
     }
   }
index 171ba6986a3c11a307a90effebedd97514ccabcb..9138b3b147423c71e331a741b86338ffc644832f 100644 (file)
@@ -519,7 +519,7 @@ static CURLcode cookie_setopts(struct OperationConfig *config, CURL *curl)
                                 ISBLANK(cl->data[0]) ? "" : " ", cl->data);
       if(result) {
         warnf("skipped provided cookie, the cookie header "
-              "would go over %u bytes", MAX_COOKIE_LINE);
+              "would go over %d bytes", MAX_COOKIE_LINE);
         return result;
       }
     }
index 30163561ea8fc75dbc2f7e3825cb282805f8e928..176d3ebc3849f9617329a5a9364b634ef2ee34ab 100644 (file)
@@ -2255,7 +2255,7 @@ static ParameterError opt_file(struct OperationConfig *config,
     break;
   case C_CONFIG: /* --config */
     if(--max_recursive < 0) {
-      errorf("Max config file recursion level reached (%u)",
+      errorf("Max config file recursion level reached (%d)",
              CONFIG_MAX_LEVELS);
       err = PARAM_BAD_USE;
     }
index 3e9fbee5907f31c90ae650ea539ddeebbd2e1aa4..ad8c77c962e9fe0ef8ec9afc2cfd0084e2aa94ae 100644 (file)
@@ -67,8 +67,8 @@ static int writeTime(FILE *stream, const struct writeoutvar *wovar,
     if(use_json)
       curl_mfprintf(stream, "\"%s\":", wovar->name);
 
-    curl_mfprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU
-                  ".%06" CURL_FORMAT_CURL_OFF_TU, secs, us);
+    curl_mfprintf(stream, "%" CURL_FORMAT_CURL_OFF_T
+                  ".%06" CURL_FORMAT_CURL_OFF_T, secs, us);
   }
   else {
     if(use_json)
index a149751d9f0f35cbde4e6b0a54a0b04f841b0087..79ff888dbb9955bb865c397143621de3db0b9985 100644 (file)
--- a/src/var.c
+++ b/src/var.c
@@ -394,7 +394,7 @@ ParameterError setvariable(const char *input)
     line++;
   nlen = line - name;
   if(!nlen || (nlen >= MAX_VAR_LEN)) {
-    warnf("Bad variable name length (%zd), skipping", nlen);
+    warnf("Bad variable name length (%zu), skipping", nlen);
     return PARAM_OK;
   }
   if(import) {
index d0aade56f61b458aaa904592aedaf57757fab268..62aa0bc36145f4488d2d128f074cb29c1acf65e7 100644 (file)
@@ -79,8 +79,8 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL)
       curl_easy_setopt(curl, CURLOPT_WRITEDATA, NULL);
       curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
       curl_msnprintf(range, sizeof(range),
-                     "%" CURL_FORMAT_CURL_OFF_TU "-"
-                     "%" CURL_FORMAT_CURL_OFF_TU,
+                     "%" CURL_FORMAT_CURL_OFF_T "-"
+                     "%" CURL_FORMAT_CURL_OFF_T,
                      (curl_off_t)0,
                      (curl_off_t)16384);
       curl_easy_setopt(curl, CURLOPT_RANGE, range);
index 57c8cebb1405669757a115476af821356ac43966..856d41ba1f269afffd6c73aa0d3b92e116d49512 100644 (file)
@@ -104,7 +104,7 @@ static CURLcode test_ws_data_m2_echo(const char *url,
   curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
   curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */
   result = curl_easy_perform(curl);
-  curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", result);
+  curl_mfprintf(stderr, "curl_easy_perform() returned %d\n", result);
   if(result != CURLE_OK)
     goto out;
 
index 5f932d1bcc0f273f23eb7550696eedef68193576..2ed12c8cab5a31735a16c5f0e37a2a5765572c59 100644 (file)
@@ -78,7 +78,7 @@ static CURLcode test_cli_ws_pingpong(const char *URL)
     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
     curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */
     result = curl_easy_perform(curl);
-    curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", result);
+    curl_mfprintf(stderr, "curl_easy_perform() returned %d\n", result);
     if(result == CURLE_OK)
       result = pingpong(curl, payload);
 
index 9a82b7ee6e28a3e41b393746fe560dc2e361d623..08d9a9363bf31415e7aebc2af4c39d147d004683 100644 (file)
@@ -163,7 +163,7 @@ CURLcode ws_send_ping(CURL *curl, const char *send_payload)
   size_t sent;
   CURLcode result = curl_ws_send(curl, send_payload, strlen(send_payload),
                                  &sent, 0, CURLWS_PING);
-  curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n",
+  curl_mfprintf(stderr, "ws: curl_ws_send returned %d, sent %zu\n",
                 result, sent);
   return result;
 }
@@ -175,7 +175,7 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload)
   char buffer[256];
   CURLcode result = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta);
   if(result) {
-    curl_mfprintf(stderr, "ws: curl_ws_recv returned %u, received %zu\n",
+    curl_mfprintf(stderr, "ws: curl_ws_recv returned %d, received %zu\n",
                   result, rlen);
     return result;
   }
@@ -201,7 +201,7 @@ void ws_close(CURL *curl)
 {
   size_t sent;
   CURLcode result = curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE);
-  curl_mfprintf(stderr, "ws: curl_ws_send returned %u, sent %zu\n",
+  curl_mfprintf(stderr, "ws: curl_ws_send returned %d, sent %zu\n",
                 result, sent);
 }
 #endif /* CURL_DISABLE_WEBSOCKETS */
index 0e203dd96f8b74ae57395d87aae0036aae417cd9..caff664720a6fd7fab94ff31794047ec7b03aa57 100644 (file)
@@ -1914,41 +1914,41 @@ static int get_nothing(void)
 
     rc = curl_url_get(u, CURLUPART_SCHEME, &p, 0);
     if(rc != CURLUE_NO_SCHEME)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
     rc = curl_url_get(u, CURLUPART_HOST, &p, 0);
     if(rc != CURLUE_NO_HOST)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
     rc = curl_url_get(u, CURLUPART_USER, &p, 0);
     if(rc != CURLUE_NO_USER)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
     rc = curl_url_get(u, CURLUPART_PASSWORD, &p, 0);
     if(rc != CURLUE_NO_PASSWORD)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
     rc = curl_url_get(u, CURLUPART_OPTIONS, &p, 0);
     if(rc != CURLUE_NO_OPTIONS)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
     rc = curl_url_get(u, CURLUPART_PATH, &p, 0);
     if(rc != CURLUE_OK)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
     else
       curl_free(p);
 
     rc = curl_url_get(u, CURLUPART_QUERY, &p, 0);
     if(rc != CURLUE_NO_QUERY)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
     rc = curl_url_get(u, CURLUPART_FRAGMENT, &p, 0);
     if(rc != CURLUE_NO_FRAGMENT)
-      curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+      curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
     rc = curl_url_get(u, CURLUPART_ZONEID, &p, 0);
     if(rc != CURLUE_NO_ZONEID)
-      curl_mfprintf(stderr, "unexpected return code %u on line %u\n", rc,
+      curl_mfprintf(stderr, "unexpected return code %d on line %d\n", rc,
                     __LINE__);
 
     curl_url_cleanup(u);
@@ -1981,17 +1981,17 @@ static int clear_url(void)
     for(i = 0; clear_url_list[i].in && !error; i++) {
       rc = curl_url_set(u, clear_url_list[i].part, clear_url_list[i].in, 0);
       if(rc != CURLUE_OK)
-        curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+        curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
       rc = curl_url_set(u, CURLUPART_URL, NULL, 0);
       if(rc != CURLUE_OK)
-        curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+        curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
 
       rc = curl_url_get(u, clear_url_list[i].part, &p, 0);
       if(rc != clear_url_list[i].ucode ||
          (clear_url_list[i].out && strcmp(p, clear_url_list[i].out) != 0)) {
 
-        curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__);
+        curl_mfprintf(stderr, "unexpected return code line %d\n", __LINE__);
         error++;
       }
       if(rc == CURLUE_OK)
@@ -2046,7 +2046,7 @@ static int huge(void)
     rc = curl_url_set(urlp, CURLUPART_URL, total, CURLU_NON_SUPPORT_SCHEME);
     if((!i && (rc != CURLUE_BAD_SCHEME)) ||
        (i && rc)) {
-      curl_mprintf("URL %u: failed to parse [%s]\n", i, total);
+      curl_mprintf("URL %d: failed to parse [%s]\n", i, total);
       error++;
     }
 
@@ -2054,7 +2054,7 @@ static int huge(void)
     if(!rc) {
       curl_url_get(urlp, part[i], &partp, 0);
       if(!partp || strcmp(partp, &bigpart[1 - (i == 4)])) {
-        curl_mprintf("URL %u part %u: failure\n", i, part[i]);
+        curl_mprintf("URL %d part %u: failure\n", i, part[i]);
         error++;
       }
       curl_free(partp);
index 5cf49ad0b6199bb16c5b8f646fa738ab7a4433fd..e6c266a7e5f4a0c75e972113fad6c8dfd481a272 100644 (file)
@@ -129,7 +129,7 @@ static CURLcode test_lib1565(const char *URL)
       }
       else {
         curl_mfprintf(stderr,
-                      "%s:%d Got an unexpected message from curl: %i\n",
+                      "%s:%d Got an unexpected message from curl: %d\n",
                       __FILE__, __LINE__, message->msg);
         result = TEST_ERR_MAJOR_BAD;
         goto test_cleanup;
index 78b2bba4c265ab094c7efaa2fa2b582274cee2d1..5e3fab8cade0cd4a35061124d4d1b95d4a67b555 100644 (file)
@@ -100,7 +100,7 @@ static CURLcode test_lib1597(const char *URL)
       break;
     }
   }
-  curl_mprintf("Tested %u strings\n", i);
+  curl_mprintf("Tested %d strings\n", i);
 
 test_cleanup:
   curl_easy_cleanup(curl);
index 4fe2bf58015859d4c89bf2c7708f63fe6a8530a1..88a6336dbe8294572adfbd53590d03b900e7cab6 100644 (file)
@@ -63,7 +63,7 @@ static CURLcode test_lib1947(const char *URL)
     if(h)
       count++;
   } while(h);
-  curl_mprintf("count = %u\n", count);
+  curl_mprintf("count = %d\n", count);
 
   /* perform another request - without redirect */
   easy_setopt(curl, CURLOPT_URL, libtest_arg2);
@@ -81,7 +81,7 @@ static CURLcode test_lib1947(const char *URL)
     if(h)
       count++;
   } while(h);
-  curl_mprintf("count = %u\n", count);
+  curl_mprintf("count = %d\n", count);
 
 test_cleanup:
   curl_easy_cleanup(curl);
index d65196e2360d3f39c7aea488d94a761becc04a3a..eee6e91237084c1ed14f91edbdf71c65c17a903b 100644 (file)
@@ -332,7 +332,7 @@ static CURLcode empty_multi_test(void)
   }
   else if(fd_count > 0) {
     curl_mfprintf(stderr, "curl_multi_waitfds(), empty, returned non-zero "
-                  "count of waitfds: %d.\n", fd_count);
+                  "count of waitfds: %u.\n", fd_count);
     result = TEST_ERR_FAILURE;
     goto test_cleanup;
   }
@@ -354,7 +354,7 @@ static CURLcode empty_multi_test(void)
   }
   else if(fd_count > 1) {
     curl_mfprintf(stderr, "curl_multi_waitfds() returned > 1 count of "
-                  "waitfds: %d.\n", fd_count);
+                  "waitfds: %u.\n", fd_count);
     result = TEST_ERR_FAILURE;
     goto test_cleanup;
   }
@@ -381,15 +381,15 @@ static CURLcode test_lib2405(const char *URL)
 
   if(testnum == 2405) {
     /* HTTP1, expected 3 waitfds - one for each transfer  + wakeup */
-    test_run_check(TEST_USE_HTTP1, 3);
+    test_run_check(TEST_USE_HTTP1, 3U);
   }
 #ifdef USE_HTTP2
   else { /* 2407 */
     /* HTTP2, expected 3 waitfds - one for each transfer + wakeup */
-    test_run_check(TEST_USE_HTTP2, 3);
+    test_run_check(TEST_USE_HTTP2, 3U);
 
     /* HTTP2 with multiplexing, expected 2 waitfds - transfers + wakeup */
-    test_run_check(TEST_USE_HTTP2_MPLEX, 2);
+    test_run_check(TEST_USE_HTTP2_MPLEX, 2U);
   }
 #endif
 
index 7b5c7c8043c03a919d9ed5a2d0da6e35622d415f..23eefa65aa1b3183fdc00c81a99fd2d70c37f119 100644 (file)
@@ -155,7 +155,7 @@ static void logprotocol(mqttdir dir,
   }
   fprintf(output, "%s %s %x %s\n",
           dir == FROM_CLIENT ? "client" : "server",
-          prefix, (int)remlen, data);
+          prefix, (unsigned int)remlen, data);
 }
 
 /* return 0 on success */
index cc7adaf0521f00f67514b80736717bb06a3bdd15..c2f62384b8df981bada201b0226c189f2009c07e 100644 (file)
@@ -1130,7 +1130,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req)
                     sizeof(req->reqbuf) - 1 - req->offset);
         if(got > 0) {
           req->offset += got;
-          logmsg("Got %zu bytes from client", got);
+          logmsg("Got %zd bytes from client", got);
         }
 
         if((got == -1) &&
index a765f1898f53224121551a3a96489d1b01781101..3a76d2769755d3e2d8b8782cbb1dd589b9258789 100644 (file)
@@ -436,7 +436,7 @@ static LRESULT CALLBACK main_window_proc(HWND hwnd, UINT uMsg,
       break;
     }
     if(signum) {
-      logmsg("main_window_proc: %d -> %d", uMsg, signum);
+      logmsg("main_window_proc: %u -> %d", uMsg, signum);
       raise(signum);
     }
   }
@@ -671,7 +671,7 @@ int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
   memset(sau, 0, sizeof(struct sockaddr_un));
   sau->sun_family = AF_UNIX;
   if(len >= sizeof(sau->sun_path) - 1) {
-    logmsg("Too long unix socket domain path (%zd)", len);
+    logmsg("Too long unix socket domain path (%zu)", len);
     return -1;
   }
   curlx_strcopy(sau->sun_path, sizeof(sau->sun_path), unix_socket, len);
index 35ac1a3b87994131ebd46bf463e6f8b3067e3afd..6965d14706c03a22e94e06fa48467819398a4cd5 100644 (file)
@@ -71,7 +71,7 @@ static CURLcode test_tool1621(const char *arg)
     const char *url = tests[i].input;
     char *stripped = stripcredentials(url);
     const char *strippedstr = stripped ? stripped : "(null)";
-    curl_mprintf("Test %u got input \"%s\", output: \"%s\", "
+    curl_mprintf("Test %d got input \"%s\", output: \"%s\", "
                  "expected: \"%s\"\n",
                  i, tests[i].input, strippedstr, tests[i].output);
 
index c705dc96eb5794b0015bd2d8940f0de2734e91b7..86eb4e25cc7987b247e3a09201e7f854b0d7abbb 100644 (file)
@@ -45,7 +45,7 @@ static CURLcode test_unit1323(const char *arg)
   for(i = 0; i < CURL_ARRAYSIZE(tests); i++) {
     timediff_t result = curlx_timediff_ms(tests[i].first, tests[i].second);
     if(result != tests[i].result) {
-      curl_mprintf("%ld.%06u to %ld.%06u got %" FMT_TIMEDIFF_T
+      curl_mprintf("%ld.%06d to %ld.%06d got %" FMT_TIMEDIFF_T
                    ", but expected %" FMT_TIMEDIFF_T "\n",
                    (long)tests[i].first.tv_sec,
                    tests[i].first.tv_usec,
index 13c1b0175ae970b3e2d2f0a196e99b5506863fc8..7d940df0559385a4f5fb093ccc69bc864797c30a 100644 (file)
@@ -102,7 +102,7 @@ static CURLcode test_unit1652(const char *arg)
   fail_unless(verify(output, input) == 0, "Simple string test");
 
   /* Injecting a few different variables with a format */
-  Curl_infof(easy, "%s %u testing %lu", input, 42, 43L);
+  Curl_infof(easy, "%s %d testing %ld", input, 42, 43L);
   fail_unless(verify(output, "Simple Test 42 testing 43\n") == 0,
               "Format string");
 
index b42a0bae7a07223a72f0b42bde6dafc02bd5d586..bc68a76c4654a273cc32d9d011eb71bcb6997603 100644 (file)
@@ -132,7 +132,7 @@ static CURLcode test_unit1660(const char *arg)
         continue;
       }
       else if(result) {
-        curl_mprintf("Input %u: error %d\n", i, (int)result);
+        curl_mprintf("Input %d: error %d\n", i, (int)result);
         continue;
       }
     }
index 4a94b6975eb9fbfd80b4827c71d40d6f17b1d952..b2f1f07b40b7daebec23dd32868b770164d7d527 100644 (file)
@@ -61,7 +61,7 @@ static CURLcode test_unit1664(const char *arg)
     const char *line = wordparse[i];
     const char *orgline = line;
     int rc = curlx_str_word(&line, &out, 7);
-    curl_mprintf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
+    curl_mprintf("%d: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
                  i, orgline, rc, (int)out.len, out.str, (int)out.len,
                  (int)(line - orgline));
   }
@@ -72,7 +72,7 @@ static CURLcode test_unit1664(const char *arg)
     const char *line = wordparse[i];
     const char *orgline = line;
     int rc = curlx_str_until(&line, &out, 7, 'd');
-    curl_mprintf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
+    curl_mprintf("%d: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
                  i, orgline, rc, (int)out.len, out.str, (int)out.len,
                  (int)(line - orgline));
   }
@@ -105,7 +105,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = qwords[i];
       const char *orgline = line;
       int rc = curlx_str_quotedword(&line, &out, 7);
-      curl_mprintf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
                    i, orgline, rc, (int)out.len, out.str, (int)out.len,
                    (int)(line - orgline));
     }
@@ -127,7 +127,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = single[i];
       const char *orgline = line;
       int rc = curlx_str_single(&line, 'a');
-      curl_mprintf("%u: (\"%s\") %d, line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, line %d\n",
                    i, orgline, rc, (int)(line - orgline));
     }
   }
@@ -150,7 +150,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = single[i];
       const char *orgline = line;
       int rc = curlx_str_singlespace(&line);
-      curl_mprintf("%u: (\"%s\") %d, line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, line %d\n",
                    i, orgline, rc, (int)(line - orgline));
     }
   }
@@ -171,7 +171,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = single[i];
       const char *orgline = line;
       int rc = curlx_str_single(&line, 'a');
-      curl_mprintf("%u: (\"%s\") %d, line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, line %d\n",
                    i, orgline, rc, (int)(line - orgline));
     }
   }
@@ -198,7 +198,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i];
       const char *orgline = line;
       int rc = curlx_str_number(&line, &num, 1235);
-      curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
                    i, orgline, rc, num, (int)(line - orgline));
     }
   }
@@ -230,7 +230,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i].str;
       const char *orgline = line;
       int rc = curlx_str_number(&line, &num, nums[i].max);
-      curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
+      curl_mprintf("%d: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
                    " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n",
                    i, orgline, nums[i].max, rc, num);
     }
@@ -270,7 +270,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i].str;
       const char *orgline = line;
       int rc = curlx_str_hex(&line, &num, nums[i].max);
-      curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
+      curl_mprintf("%d: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
                    " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n",
                    i, orgline, nums[i].max, rc, num);
     }
@@ -305,7 +305,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i].str;
       const char *orgline = line;
       int rc = curlx_str_octal(&line, &num, nums[i].max);
-      curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
+      curl_mprintf("%d: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
                    " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n",
                    i, orgline, nums[i].max, rc, num);
     }
@@ -341,7 +341,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i];
       const char *orgline = line;
       int rc = curlx_str_number(&line, &num, CURL_OFF_T_MAX);
-      curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
                    i, orgline, rc, num, (int)(line - orgline));
     }
   }
@@ -366,7 +366,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = newl[i];
       const char *orgline = line;
       int rc = curlx_str_newline(&line);
-      curl_mprintf("%u: (%%%02x) %d, line %d\n",
+      curl_mprintf("%d: (%%%02x) %d, line %d\n",
                    i, *orgline, rc, (int)(line - orgline));
     }
   }
@@ -393,7 +393,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i];
       const char *orgline = line;
       int rc = curlx_str_hex(&line, &num, 0x1235);
-      curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
                    i, orgline, rc, num, (int)(line - orgline));
     }
   }
@@ -420,7 +420,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i];
       const char *orgline = line;
       int rc = curlx_str_octal(&line, &num, 01235);
-      curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
                    i, orgline, rc, num, (int)(line - orgline));
     }
   }
@@ -444,7 +444,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i];
       const char *orgline = line;
       int rc = curlx_str_octal(&line, &num, CURL_OFF_T_MAX);
-      curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
                    i, orgline, rc, num, (int)(line - orgline));
     }
   }
@@ -480,7 +480,7 @@ static CURLcode test_unit1664(const char *arg)
       const char *line = nums[i];
       const char *orgline = line;
       int rc = curlx_str_hex(&line, &num, CURL_OFF_T_MAX);
-      curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
+      curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
                    i, orgline, rc, num, (int)(line - orgline));
     }
   }
index 25616c6727672fad7f0007b01fab101f7ef4d259..2a1d39de37e0f40e0b41a20f7fb081a8b29d2989 100644 (file)
@@ -185,7 +185,7 @@ static CURLcode test_unit1675(const char *arg)
       uc = urlencode_str(&out, tests[i].in, strlen(tests[i].in),
                          tests[i].relative, tests[i].query);
       if(uc || strcmp(curlx_dyn_ptr(&out), tests[i].out)) {
-        curl_mfprintf(stderr, "urlencode_str('%s', query=%d) failed:"
+        curl_mfprintf(stderr, "urlencode_str('%s', query=%u) failed:"
                       " expected '%s', got '%s'\n",
                       tests[i].in, tests[i].query, tests[i].out,
                       uc ? "error" : curlx_dyn_ptr(&out));
index 15ec12c41d211c433ad3ebe5258e42f66c246cf3..195f796a60ed123ca5131f2983876e94821885a4 100644 (file)
@@ -82,7 +82,7 @@ static void parse_success(const struct tcase *t)
     in_consumed += nread;
     if(nread != buflen) {
       if(!p.done) {
-        curl_mfprintf(stderr, "only %zd/%zu consumed for: '%s'\n",
+        curl_mfprintf(stderr, "only %zu/%zu consumed for: '%s'\n",
                       nread, buflen, buf);
         fail("not all consumed");
       }
index 040874aff361c6b80c5d8bd54e5e5ff24b2a600e..2143413713fd04ab184fecb48e56745df1ba8d39 100644 (file)
@@ -86,7 +86,7 @@ static CURLcode test_unit2604(const char *arg)
     char *path;
     const char *cp = i == 0 ? cp0 : list[i].cp;
     CURLcode result = Curl_get_pathname(&cp, &path, list[i].home);
-    curl_mprintf("%u - Curl_get_pathname(\"%s\", ... \"%s\") == %u\n", i,
+    curl_mprintf("%d - Curl_get_pathname(\"%s\", ... \"%s\") == %d\n", i,
                  list[i].cp, list[i].home, list[i].result);
     if(result != list[i].result) {
       curl_mprintf("... returned %d\n", result);
index 0f6e8cb009c750a2688c1decd9a702bf614514c3..d26c8a1299e618a01e4b348bfd477a23d324b676 100644 (file)
@@ -78,7 +78,7 @@ static CURLcode test_unit2605(const char *arg)
       curl_off_t start;
       curl_off_t size;
       CURLcode result;
-      curl_mprintf("%u: '%s' (file size: %" FMT_OFF_T ")\n", i, list[i].r,
+      curl_mprintf("%d: '%s' (file size: %" FMT_OFF_T ")\n", i, list[i].r,
                    list[i].filesize);
       result = Curl_ssh_range(curl, list[i].r, list[i].filesize, &start,
                               &size);
index 35661637059e2a5c5db712ba1a8d725d71416727..3e1b06a0aafecf12d4717ce9509c4478c9bbbbd6 100644 (file)
@@ -92,7 +92,7 @@ static CURLcode test_unit3200(const char *arg)
     fp = curlx_fopen(arg, "rb");
     abort_unless(fp != NULL, "Cannot open testfile");
 
-    curl_mfprintf(stderr, "Test %zd...", i);
+    curl_mfprintf(stderr, "Test %zu...", i);
     switch(i) {
     case 0:
       result = Curl_get_line(&buf, fp, &eof);