aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-11-29 13:20:18 +0100
committerStefano Brivio <sbrivio@redhat.com>2023-12-02 03:54:47 +0100
commit7e175f32c1213bc4d86b039059164dcb1c4ed2e5 (patch)
tree7ae7f6fb723002c532963553a13d6f85aa195545
parent06559048e76343211618ddea02d6739ca578b775 (diff)
downloadpasst-7e175f32c1213bc4d86b039059164dcb1c4ed2e5.tar
passt-7e175f32c1213bc4d86b039059164dcb1c4ed2e5.tar.gz
passt-7e175f32c1213bc4d86b039059164dcb1c4ed2e5.tar.bz2
passt-7e175f32c1213bc4d86b039059164dcb1c4ed2e5.tar.lz
passt-7e175f32c1213bc4d86b039059164dcb1c4ed2e5.tar.xz
passt-7e175f32c1213bc4d86b039059164dcb1c4ed2e5.tar.zst
passt-7e175f32c1213bc4d86b039059164dcb1c4ed2e5.zip
packet: Offset plus length is not always uint32_t, but it's always size_t
According to gcc, PRIu32 matches the type of the argument we're printing here on both 64 and 32-bits architectures. According to Clang, though, that's not the case, as the result of the sum is an unsigned long on 64-bit. Use the z modifier, given that we're summing uint32_t to size_t, and the result is at most promoted to size_t. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index 12ac76b..ccfc846 100644
--- a/packet.c
+++ b/packet.c
@@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (p->pkt[idx].offset + len + offset > p->buf_size) {
if (func) {
- trace("packet offset plus length %lu from size %zu, "
+ trace("packet offset plus length %zu from size %zu, "
"%s:%i", p->pkt[idx].offset + len + offset,
p->buf_size, func, line);
}