From 6b557d7c933442377de59b71d0d82c3ccba68b2e Mon Sep 17 00:00:00 2001 From: Rami Rosen Date: Tue, 10 Jan 2017 11:19:25 +0200 Subject: [PATCH] ui: fix format specfier in vnc to avoid break in build. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Message-id: 1484039965-25907-1-git-send-email-rami.rosen@intel.com Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index cf9b597d1d..6854fdb02f 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1257,7 +1257,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"); } -- 2.39.5