From: Frédéric Lécaille Date: Wed, 22 Feb 2023 16:24:23 +0000 (+0100) Subject: BUILD: quic: 32-bits compilation issue with %zu in quic_rx_pkts_del() X-Git-Tag: v2.8-dev5~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7a13be6cd20b3840ae516fc423bae27576314da;p=thirdparty%2Fhaproxy.git BUILD: quic: 32-bits compilation issue with %zu in quic_rx_pkts_del() 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. --- diff --git a/src/quic_conn.c b/src/quic_conn.c index 3de0d90054..290df71795 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",