From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxJeY-0008S0-4T for qemu-devel@nongnu.org; Wed, 18 Jun 2014 13:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxJeR-0001xX-8U for qemu-devel@nongnu.org; Wed, 18 Jun 2014 13:28:06 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=59948 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxJeR-0001xR-1S for qemu-devel@nongnu.org; Wed, 18 Jun 2014 13:27:59 -0400 Message-ID: <53A1CC18.2000203@weilnetz.de> Date: Wed, 18 Jun 2014 19:27:52 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1403039230-3427-1-git-send-email-sw@weilnetz.de> <53A1157E.9020409@twiddle.net> <53A1163A.1060902@weilnetz.de> <53A1194F.606@weilnetz.de> <53A1ADE8.3010800@twiddle.net> In-Reply-To: <53A1ADE8.3010800@twiddle.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] libvixl: Add gcc format attribute List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , Peter Maydell Cc: qemu-devel@nongnu.org Am 18.06.2014 17:19, schrieb Richard Henderson: > > On 06/17/2014 09:45 PM, Stefan Weil wrote: >> >> Variable arguments usually are not converted to 64 bit values: if >> they are smaller than int, they are expanded to int, and larger >> values are passed as they are. But here obviously the compiler >> expands uint32_t to int64_t. Why? > > They really really shouldn't be. It might be worth trying something > more recent than 4.6.3, and if it persists file a bug. r~ I found the source of the problem. The compiler is correct. Eight format strings in disas/libvixl/a64/disasm-a64.cc are wrong. The functions which are called don't come from disas/libvixl/a64/assembler-a64.h as I expected. They are generated by code in disas/libvixl/a64/instructions-a64.h: #define DEFINE_GETTER(Name, HighBit, LowBit, Func) \ inline int64_t Name() const { return Func(HighBit, LowBit); } INSTRUCTION_FIELDS_LIST(DEFINE_GETTER) #undef DEFINE_GETTER So each of those functions really returns an int64_t which of course should not use a "%d" format string. Stefan