From patchwork Thu Jun 16 16:29:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9181329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8AD5A60776 for ; Thu, 16 Jun 2016 16:30:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BB442835E for ; Thu, 16 Jun 2016 16:30:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 705F028365; Thu, 16 Jun 2016 16:30:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 01D432835E for ; Thu, 16 Jun 2016 16:30:39 +0000 (UTC) Received: from localhost ([::1]:50756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDaBh-0000NH-0N for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jun 2016 12:30:37 -0400 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 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 190DD627D1; Thu, 16 Jun 2016 16:29:34 +0000 (UTC) Received: from [10.36.112.58] (ovpn-112-58.ams2.redhat.com [10.36.112.58]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5GGTUL3021141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Jun 2016 12:29:32 -0400 To: Peter Maydell 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 16 Jun 2016 16:29:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PULL 00/30] KVM, build, NBD, SCSI patches for 2016-06-16 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU Developers Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 > /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__); \ > ^ 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);