* [Qemu-devel] [PATCH v2] ui: fix format specfier in vnc to avoid break in build.
@ 2017-01-10 9:19 Rami Rosen
2017-01-10 12:31 ` Gerd Hoffmann
0 siblings, 1 reply; 2+ messages in thread
From: Rami Rosen @ 2017-01-10 9:19 UTC (permalink / raw)
To: qemu-devel; +Cc: eblake, Rami Rosen
When building qemu after setting _VNC_DEBUG to 1 (see ui/vnc.h),
we get the following error and the build breaks:
...
ui/vnc.c: In function ‘vnc_client_io_error’:
ui/vnc.c:1262:13: error: format ‘%d’ expects argument of type ‘int’, but
VNC_DEBUG("Closing down client sock: ret %d (%s)\n",
^
cc1: all warnings being treated as errors
make: *** [ui/vnc.o] Error 1
...
This patch solves this issue by fixing the print format specifier
in vnc_client_io_error() to be %zd, which corresponds to the type
of the "ret" variable.
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
---
changes v2:
- use %zd instead of %ld for the format sepcifier.
ui/vnc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 2c28a59..6b0672b 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1259,7 +1259,7 @@ ssize_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp)
if (ret == 0) {
VNC_DEBUG("Closing down client sock: EOF\n");
} else if (ret != QIO_CHANNEL_ERR_BLOCK) {
- VNC_DEBUG("Closing down client sock: ret %d (%s)\n",
+ VNC_DEBUG("Closing down client sock: ret %zd (%s)\n",
ret, errp ? error_get_pretty(*errp) : "Unknown");
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-10 12:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-10 9:19 [Qemu-devel] [PATCH v2] ui: fix format specfier in vnc to avoid break in build Rami Rosen
2017-01-10 12:31 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).