From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH] lib: use %zu conversion for sizeof to fix i386 build Date: Fri, 12 May 2017 17:57:35 +0200 Message-ID: <20170512155735.GE13216@potion> References: <20170512151545.13507-1-rkrcmar@redhat.com> <20170512152846.GC13216@potion> <97fe2204-3ecc-fa2a-654e-0fc80cf10c80@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, Peter Feiner To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50494 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755284AbdELP5j (ORCPT ); Fri, 12 May 2017 11:57:39 -0400 Content-Disposition: inline In-Reply-To: <97fe2204-3ecc-fa2a-654e-0fc80cf10c80@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2017-05-12 17:43+0200, Paolo Bonzini: > On 12/05/2017 17:28, Radim Krčmář wrote: > > 2017-05-12 17:15+0200, Radim Krčmář: > >> Fixes this GCC error: > >> > >> In file included from lib/report.c:13:0: > >> lib/libcflat.h:134:10: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘unsigned int’ [-Werror=format=] > >> printf("%s:%d: assert failed: %s: " fmt "\n", \ > >> ^ > >> lib/report.c:53:2: note: in expansion of macro ‘assert_msg’ > >> assert_msg(len < sizeof(prefixes), "%d >= %lu", len, sizeof(prefixes)); > >> ^~~~~~~~~~ > >> lib/report.c:53:46: note: format string is defined here > >> assert_msg(len < sizeof(prefixes), "%d >= %lu", len, sizeof(prefixes)); > >> ~~^ > >> %u > >> > >> Signed-off-by: Radim Krčmář > >> --- > > > > Ugh, and I didn't test it ... libcflat doesn't support %z. > > Let's add it, I have sent a patch. Right, shame on me for fixing it on the wrong side! Applied after your patch, Thanks.