]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: quic: Fix build for m68k cross-compilation
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 18 Oct 2022 09:57:01 +0000 (11:57 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 18 Oct 2022 10:04:10 +0000 (12:04 +0200)
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

src/qmux_trace.c

index 00a1d8d27f93057f8e00d9b7cb8682715234457c..5f2e26245d83b1a8c4939f2e5c4d304667675450 100644 (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);
                }
        }
 }