From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDaAi-0008Po-RG for qemu-devel@nongnu.org; Thu, 16 Jun 2016 12:29:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDaAg-0004FD-PJ for qemu-devel@nongnu.org; Thu, 16 Jun 2016 12:29:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDaAg-0004F3-GV for qemu-devel@nongnu.org; Thu, 16 Jun 2016 12:29:34 -0400 References: <1466086585-16526-1-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <7a3acf1b-ff2b-e298-bf4e-9e20f1974965@redhat.com> Date: Thu, 16 Jun 2016 18:29:30 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 00/30] KVM, build, NBD, SCSI patches for 2016-06-16 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Eric Blake On 16/06/2016 18:02, Peter Maydell wrote: > Hi. I'm afraid this generates format string warnings on OSX: Interesting, I did test clang this time. I'll fix it but really this is a compiler bug. It's *impossible* to pass a short variable argument, hence va_arg(ap, short) *must* be the same as va_arg(ap, int). I should start making a list of pointless clang warnings. Paolo diff --git a/nbd/server.c b/nbd/server.c index ba950973..a677e26 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -576,7 +576,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) oldStyle = client->exp != NULL && !client->tlscreds; if (oldStyle) { assert ((client->exp->nbdflags & ~65535) == 0); - TRACE("advertising size %" PRIu64 " and flags %" PRIx16, + TRACE("advertising size %" PRIu64 " and flags %x", client->exp->size, client->exp->nbdflags | myflags); stq_be_p(buf + 8, NBD_CLIENT_MAGIC); stq_be_p(buf + 16, client->exp->size); @@ -607,7 +607,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) } assert ((client->exp->nbdflags & ~65535) == 0); - TRACE("advertising size %" PRIu64 " and flags %" PRIx16, + TRACE("advertising size %" PRIu64 " and flags %x", client->exp->size, client->exp->nbdflags | myflags); stq_be_p(buf + 18, client->exp->size); stw_be_p(buf + 26, client->exp->nbdflags | myflags); > /Users/pm215/src/qemu-for-merges/nbd/server.c:580:34: warning: format > specifies type 'unsigned short' but the argument has type 'unsigned > int' [-Wformat] > client->exp->size, client->exp->nbdflags | myflags); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:44:21: note: > expanded from macro 'TRACE' > LOG(msg, ## __VA_ARGS__); \ > ^ > /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:50:50: note: > expanded from macro 'LOG' > __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \ > ^ > /Users/pm215/src/qemu-for-merges/nbd/server.c:611:34: warning: format > specifies type 'unsigned short' but the argument has type 'unsigned > int' [-Wformat] > client->exp->size, client->exp->nbdflags | myflags); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:44:21: note: > expanded from macro 'TRACE' > LOG(msg, ## __VA_ARGS__); \ > ^ > /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:50:50: note: > expanded from macro 'LOG' > __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \ > ^ > CC nbd/client.o > CC nbd/common.o > CC block/curl.o > /Users/pm215/src/qemu-for-merges/nbd/client.c:715:57: warning: format > specifies type 'unsigned short' but the argument has type 'uint32_t' > (aka 'unsigned int') [-Wformat] > request->from, request->len, request->handle, request->type); > ^~~~~~~~~~~~~ > /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:44:21: note: > expanded from macro 'TRACE' > LOG(msg, ## __VA_ARGS__); \ > ^ > /Users/pm215/src/qemu-for-merges/nbd/nbd-internal.h:50:50: note: > expanded from macro 'LOG' > __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__); \ > ^