From: Frédéric Lécaille Date: Tue, 18 Oct 2022 09:57:01 +0000 (+0200) Subject: BUILD: quic: Fix build for m68k cross-compilation X-Git-Tag: v2.7-dev9~164 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea492e3e471a18c2ff8760c66141c51a7ee99780;p=thirdparty%2Fhaproxy.git BUILD: quic: Fix build for m68k cross-compilation Fix several warinings as this one: src/qmux_trace.c:80:45: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘const long long unsigned int’} [-Werror=format=] 80 | chunk_appendf(&trace_buf, " qcs=%p .id=%lu .st=%s", | ~~^ | | | long unsigned int | %llu 81 | qcs, qcs->id, | ~~~~~~~ | | | uint64_t {aka const long long unsigned int} compilation terminated due to -Wfatal-errors. Cast remaining uint64_t variables as ullong with %llu as printf format and size_t others as ulong with %lu as printf format. Thank you to Ilya for having reported this issue in GH #1899. Must be backported to 2.6 --- diff --git a/src/qmux_trace.c b/src/qmux_trace.c index 00a1d8d27f..5f2e26245d 100644 --- a/src/qmux_trace.c +++ b/src/qmux_trace.c @@ -77,13 +77,13 @@ static void qmux_trace(enum trace_level level, uint64_t mask, chunk_appendf(&trace_buf, " qc=%p", qcc->conn->handle.qc); if (qcs) - chunk_appendf(&trace_buf, " qcs=%p .id=%lu .st=%s", - qcs, qcs->id, + chunk_appendf(&trace_buf, " qcs=%p .id=%llu .st=%s", + qcs, (ullong)qcs->id, qcs_st_to_str(qcs->st)); if (mask & QMUX_EV_QCC_NQCS) { const uint64_t *id = a3; - chunk_appendf(&trace_buf, " id=%lu", *id); + chunk_appendf(&trace_buf, " id=%llu", (ullong)*id); } if (mask & QMUX_EV_SEND_FRM) @@ -92,13 +92,13 @@ static void qmux_trace(enum trace_level level, uint64_t mask, if (mask & QMUX_EV_QCS_XFER_DATA) { const struct qcs_xfer_data_trace_arg *arg = a3; chunk_appendf(&trace_buf, " prep=%lu xfer=%d", - arg->prep, arg->xfer); + (ulong)arg->prep, arg->xfer); } if (mask & QMUX_EV_QCS_BUILD_STRM) { const struct qcs_build_stream_trace_arg *arg = a3; - chunk_appendf(&trace_buf, " len=%lu fin=%d offset=%lu", - arg->len, arg->fin, arg->offset); + chunk_appendf(&trace_buf, " len=%lu fin=%d offset=%llu", + (ulong)arg->len, arg->fin, (ullong)arg->offset); } } }