Received: from eggs.gnu.org ([2001:4830:134:3::10]:35134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViAKI-0000iK-U0 for qemu-devel@nongnu.org; Sun, 17 Nov 2013 16:56:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViAKD-0007HQ-90 for qemu-devel@nongnu.org; Sun, 17 Nov 2013 16:56:18 -0500 Message-ID: <52893B6F.60300@weilnetz.de> Date: Sun, 17 Nov 2013 22:55:59 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1384711222-8916-1-git-send-email-sw@weilnetz.de> <528929B8.9010706@msgid.tls.msk.ru> In-Reply-To: <528929B8.9010706@msgid.tls.msk.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH for 1.7] acpi-build: Fix compiler warning (missing gnu_printf format attribute) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: qemu-trivial@nongnu.org, qemu-devel , Anthony Liguori Am 17.11.2013 21:40, schrieb Michael Tokarev: > 17.11.2013 22:00, Stefan Weil wrote: >> gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextr= a): >> >> CC m68k-softmmu/hw/m68k/mcf5206.o >> hw/i386/acpi-build.c: In function =E2=80=98build_append_nameseg=E2=80=99= : >> hw/i386/acpi-build.c:294:5: error: >> function might be possible candidate for =E2=80=98gnu_printf=E2=80=99= format attribute [-Werror=3Dsuggest-attribute=3Dformat] >> g_string_vprintf(s, format, args); >> ^ > Why are you sending for-1.7 patches which fixes issues which are not > present in 1.7? As far as I can see, -Wextra isn't enabled in 1.7, is = it? > > Thanks, > > /mjt We try to use format attributes for all functions with printf like arguments. Patch http://patchwork.ozlabs.org/patch/291873/ shows that the format attribute not only fixes a compiler warning (which is not shown with the default settings) but also uncovers real programming errors. I use quite a lot of build environments (32 and 64 bit, Linux and Windows cross builds) but there still remain more which I don't cover. With the additional format attributes any code either is okay and compiles without warning, or it uses a wrong format string, so my patches will break only builds which compile broken code. I think this kind of build breakage is good and important. Regards, Stefan