From b7a13be6cd20b3840ae516fc423bae27576314da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Wed, 22 Feb 2023 17:24:23 +0100 Subject: [PATCH] BUILD: quic: 32-bits compilation issue with %zu in quic_rx_pkts_del() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This issue arrived with this commit: 1dbeb35f8 MINOR: quic: Add new traces about by connection RX buffer handling and revealed by the GH CI as follows: src/quic_conn.c: In function ‘quic_rx_pkts_del’: include/haproxy/trace.h:134:65: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 6 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=] _msg_len = snprintf(_msg, sizeof(_msg), (fmt), ##args); Replace all %zu printf integer format by %llu. Must be backported to 2.7 where the previous is supposed to be backported. --- src/quic_conn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/quic_conn.c b/src/quic_conn.c index 3de0d9005..290df7179 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -6585,16 +6585,16 @@ static inline void quic_rx_pkts_del(struct quic_conn *qc) list_for_each_entry_safe(pkt, pktback, &qc->rx.pkt_list, qc_rx_pkt_list) { TRACE_PRINTF(TRACE_LEVEL_DEVELOPER, QUIC_EV_CONN_LPKT, qc, 0, 0, 0, - "pkt #%lld(type=%d,len=%zu,rawlen=%zu,refcnt=%u) (diff: %zd)", + "pkt #%lld(type=%d,len=%llu,rawlen=%llu,refcnt=%u) (diff: %zd)", (long long)pkt->pn_node.key, - pkt->type, pkt->len, pkt->raw_len, pkt->refcnt, + pkt->type, (ull)pkt->len, (ull)pkt->raw_len, pkt->refcnt, (unsigned char *)b_head(&qc->rx.buf) - pkt->data); if (pkt->data != (unsigned char *)b_head(&qc->rx.buf)) { size_t cdata; cdata = b_contig_data(&qc->rx.buf, 0); TRACE_PRINTF(TRACE_LEVEL_DEVELOPER, QUIC_EV_CONN_LPKT, qc, 0, 0, 0, - "cdata=%zu *b_head()=0x%x", cdata, *b_head(&qc->rx.buf)); + "cdata=%llu *b_head()=0x%x", (ull)cdata, *b_head(&qc->rx.buf)); if (cdata && !*b_head(&qc->rx.buf)) { /* Consume the remaining data */ b_del(&qc->rx.buf, cdata); @@ -6662,7 +6662,7 @@ static void qc_rx_pkt_handle(struct quic_conn *qc, struct quic_rx_packet *pkt, b_cspace = b_contig_space(&qc->rx.buf); if (b_cspace < pkt->len) { TRACE_PRINTF(TRACE_LEVEL_DEVELOPER, QUIC_EV_CONN_LPKT, qc, 0, 0, 0, - "bspace=%zu pkt->len=%zu", b_cspace, pkt->len); + "bspace=%llu pkt->len=%llu", (ull)b_cspace, (ull)pkt->len); /* Do not consume buf if space not at the end. */ if (b_tail(&qc->rx.buf) + b_cspace < b_wrap(&qc->rx.buf)) { TRACE_PROTO("Packet dropped",