From nobody Sat Apr 20 06:03:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1487615380100912.9565519566034; Mon, 20 Feb 2017 10:29:40 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1KIQE4R002729; Mon, 20 Feb 2017 13:26:15 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1KIQC0b016574 for ; Mon, 20 Feb 2017 13:26:12 -0500 Received: from t460.redhat.com (ovpn-116-165.ams2.redhat.com [10.36.116.165]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1KIQAuY014554; Mon, 20 Feb 2017 13:26:11 -0500 From: "Daniel P. Berrange" To: libvir-list@redhat.com Date: Mon, 20 Feb 2017 18:26:07 +0000 Message-Id: <20170220182607.18579-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] Format printf format specifier used with niothreadids X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The niothreadids struct field is size_t, so must use %zu not %lu with printf. While they're identical on some platforms, on others they are different, causing warnings conf/domain_conf.c: In function 'virDomainDefCheckABIStabilityFlags': conf/domain_conf.c:19575:26: error: format '%lu' expects argument of type '= long unsigned int', but argument 7 has type 'size_t {aka unsigned int}' [-W= error=3Dformat=3D] _("Target domain iothreads count %lu does not " ^ conf/domain_conf.c: In function 'virDomainDefFormatInternal': conf/domain_conf.c:23915:46: error: format '%lu' expects argument of type '= long unsigned int', but argument 3 has type 'size_t {aka unsigned int}' [-W= error=3Dformat=3D] virBufferAsprintf(buf, "%lu\n", ^ Signed-off-by: Daniel P. Berrange --- Pushed to fix Win32 builds src/conf/domain_conf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ea2cd0e..79bdbdf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19572,8 +19572,8 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr = src, =20 if (src->niothreadids !=3D dst->niothreadids) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target domain iothreads count %lu does not " - "match source %lu"), + _("Target domain iothreads count %zu does not " + "match source %zu"), dst->niothreadids, src->niothreadids); goto error; } @@ -23912,7 +23912,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, goto error; =20 if (def->niothreadids > 0) { - virBufferAsprintf(buf, "%lu\n", + virBufferAsprintf(buf, "%zu\n", def->niothreadids); if (virDomainDefIothreadShouldFormat(def)) { virBufferAddLit(buf, "\n"); --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list