From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx7JI-0008EP-M4 for qemu-devel@nongnu.org; Wed, 18 Jun 2014 00:17:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wx7JC-00061e-Uw for qemu-devel@nongnu.org; Wed, 18 Jun 2014 00:17:20 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=49374 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wx7JC-00060z-O8 for qemu-devel@nongnu.org; Wed, 18 Jun 2014 00:17:14 -0400 Message-ID: <53A112BB.2000006@weilnetz.de> Date: Wed, 18 Jun 2014 06:16:59 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1403039230-3427-1-git-send-email-sw@weilnetz.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] libvixl: Add gcc format attribute List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Richard Henderson Am 18.06.2014 00:09, schrieb Peter Maydell: > On 17 June 2014 22:07, Stefan Weil wrote: >> This helps detecting wrong format strings. >> >> Signed-off-by: Stefan Weil >> --- >> >> This patch is not intended to be applied before fixing some potential = errors. >> >> Addings the GNU gcc format attribute results in lots of compiler error= s like these ones: >> >> CXX disas/libvixl/a64/disasm-a64.o >> disas/libvixl/a64/disasm-a64.cc: In member function =E2=80=98int vixl:= :Disassembler::SubstituteImmediateField(vixl::Instruction*, const char*)=E2= =80=99: >> disas/libvixl/a64/disasm-a64.cc:1372:66: error: format =E2=80=98%d=E2=80= =99 expects argument of type =E2=80=98int=E2=80=99, but argument 3 has ty= pe =E2=80=98int64_t {aka long int}=E2=80=99 [-Werror=3Dformat] >> disas/libvixl/a64/disasm-a64.cc:1421:52: error: format =E2=80=98%d=E2=80= =99 expects argument of type =E2=80=98int=E2=80=99, but argument 3 has ty= pe =E2=80=98int64_t {aka long int}=E2=80=99 [-Werror=3Dformat] >> disas/libvixl/a64/disasm-a64.cc:1442:48: error: format =E2=80=98%d=E2=80= =99 expects argument of type =E2=80=98int=E2=80=99, but argument 3 has ty= pe =E2=80=98int64_t {aka long int}=E2=80=99 [-Werror=3Dformat] >> disas/libvixl/a64/disasm-a64.cc:1449:42: error: format =E2=80=98%d=E2=80= =99 expects argument of type =E2=80=98int=E2=80=99, but argument 3 has ty= pe =E2=80=98int64_t {aka long int}=E2=80=99 [-Werror=3Dformat] >> >> I don't know the reason, because all locations seem to have arguments >> which are function calls, and the called function returns Instr which >> is uint32_t, not int64_t. >=20 > As usual, I'm sceptical about carrying local libvixl patches > unless they're really necessary. >=20 > Which platform are you building on, and what does it > define uint32_t and int64_t as? I agree that it looks to me > like the compiler's wrong here, but maybe there's an integer > promotion rule for varargs I'm unaware of that means the > uint32_t gets promoted to int64_t ? >=20 > If the format strings really are wrong we can feed that back > to upstream libvixl and get them fixed there. >=20 > thanks > -- PMM >=20 The platform is Debian wheezy (64 bit) with gcc-4.7.2, but I'm afraid any of my builds shows these errors. Stefan