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

(cherry picked from commit ea492e3e471a18c2ff8760c66141c51a7ee99780)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
This commit is contained in:
Frédéric Lécaille 2022-10-18 11:57:01 +02:00 committed by Christopher Faulet
parent 8c26e397c2
commit c387bf149b

View File

@ -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);
}
}
}