Skip to content

Commit 4fe2934

Browse files
elmarcobonzini
authored andcommitted
libvhost-user: fix -Werror=format= warnings with __u64 fields
../subprojects/libvhost-user/libvhost-user.c:1070:12: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long long unsigned int’} [-Werror=format=] 1070 | DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", vra->desc_user_addr); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ | | | __u64 {aka long long unsigned int} Rather than using %llx, which may fail if __u64 is declared differently elsewhere, let's just cast the values. Feel free to propose a better solution! Signed-off-by: Marc-André Lureau <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 3f55f97 commit 4fe2934

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

subprojects/libvhost-user/libvhost-user.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,10 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)
10671067
DPRINT("vhost_vring_addr:\n");
10681068
DPRINT(" index: %d\n", vra->index);
10691069
DPRINT(" flags: %d\n", vra->flags);
1070-
DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", vra->desc_user_addr);
1071-
DPRINT(" used_user_addr: 0x%016" PRIx64 "\n", vra->used_user_addr);
1072-
DPRINT(" avail_user_addr: 0x%016" PRIx64 "\n", vra->avail_user_addr);
1073-
DPRINT(" log_guest_addr: 0x%016" PRIx64 "\n", vra->log_guest_addr);
1070+
DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->desc_user_addr);
1071+
DPRINT(" used_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->used_user_addr);
1072+
DPRINT(" avail_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->avail_user_addr);
1073+
DPRINT(" log_guest_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->log_guest_addr);
10741074

10751075
vq->vra = *vra;
10761076
vq->vring.flags = vra->flags;

0 commit comments

Comments
 (0)