From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44359 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKBGG-0006xP-SZ for qemu-devel@nongnu.org; Sun, 21 Nov 2010 09:51:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKBGA-0006oo-33 for qemu-devel@nongnu.org; Sun, 21 Nov 2010 09:51:24 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:49607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKBG9-0006of-UV for qemu-devel@nongnu.org; Sun, 21 Nov 2010 09:51:18 -0500 Received: by yxs7 with SMTP id 7so761299yxs.4 for ; Sun, 21 Nov 2010 06:51:17 -0800 (PST) Message-ID: <4CE931E2.2010504@codemonkey.ws> Date: Sun, 21 Nov 2010 08:51:14 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] configure: Add compiler option -Wmissing-format-attribute References: <1289852574-21577-1-git-send-email-weil@mail.berlios.de> In-Reply-To: <1289852574-21577-1-git-send-email-weil@mail.berlios.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Blue Swirl , QEMU Developers On 11/15/2010 02:22 PM, Stefan Weil wrote: > With the previous patches, hopefully all functions with > printf like arguments use gcc's format checking. > > This was tested with default build configuration on linux > and windows hosts (including some cross compilations), > so chances are good that there remain few (if any) functions > without format checking. > > Cc: Blue Swirl > Signed-off-by: Stefan Weil > This breaks the build for me. disas.c doesn't build. Regards, Anthony Liguori > --- > HACKING | 3 --- > configure | 1 + > 2 files changed, 1 insertions(+), 3 deletions(-) > > diff --git a/HACKING b/HACKING > index 6ba9d7e..3af53fd 100644 > --- a/HACKING > +++ b/HACKING > @@ -120,6 +120,3 @@ gcc's printf attribute directive in the prototype. > This makes it so gcc's -Wformat and -Wformat-security options can do > their jobs and cross-check format strings with the number and types > of arguments. > - > -Currently many functions in QEMU are not following this rule but > -patches to add the attribute would be very much appreciated. > diff --git a/configure b/configure > index 7025d2b..d4c983a 100755 > --- a/configure > +++ b/configure > @@ -140,6 +140,7 @@ windres="${cross_prefix}${windres}" > QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" > CFLAGS="-g $CFLAGS" > QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" > +QEMU_CFLAGS="-Wmissing-format-attribute $QEMU_CFLAGS" > QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" > QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" > QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" >