Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzzXq-0001rJ-CU for qemu-devel@nongnu.org; Thu, 08 Apr 2010 17:45:50 -0400 Received: from [140.186.70.92] (port=47075 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzzXo-0001q8-3w for qemu-devel@nongnu.org; Thu, 08 Apr 2010 17:45:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzzXe-0002ek-3H for qemu-devel@nongnu.org; Thu, 08 Apr 2010 17:45:45 -0400 Received: from hall.aurel32.net ([88.191.82.174]:58767) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzzXd-0002bJ-Tj for qemu-devel@nongnu.org; Thu, 08 Apr 2010 17:45:38 -0400 Date: Thu, 8 Apr 2010 21:43:03 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] target-i386: Fix compiler warning Message-ID: <20100408194303.GL6056@volta.aurel32.net> References: <1270145010-18452-1-git-send-email-weil@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1270145010-18452-1-git-send-email-weil@mail.berlios.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: QEMU Developers On Thu, Apr 01, 2010 at 08:03:30PM +0200, Stefan Weil wrote: > With argument checking for cpu_fprintf, gcc throws this warning: > > CC i386-softmmu/helper.o > cc1: warnings being treated as errors > /qemu/ar7/target-i386/helper.c: In function ‘cpu_x86_dump_seg_cache’: > /qemu/ar7/target-i386/helper.c:220: error: format not a string literal and no format arguments > > The code is correct, but current gcc versions don't detect this. > Therefore the patch rewrites the statement to satisfy the compiler. Thanks, applied. > Signed-off-by: Stefan Weil > --- > target-i386/helper.c | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/target-i386/helper.c b/target-i386/helper.c > index 136ca8d..67c1224 100644 > --- a/target-i386/helper.c > +++ b/target-i386/helper.c > @@ -214,9 +214,10 @@ cpu_x86_dump_seg_cache(CPUState *env, FILE *f, > "Reserved", "IntGate64", "TrapGate64" > } > }; > - cpu_fprintf(f, sys_type_name[(env->hflags & HF_LMA_MASK) ? 1 : 0] > - [(sc->flags & DESC_TYPE_MASK) > - >> DESC_TYPE_SHIFT]); > + cpu_fprintf(f, "%s", > + sys_type_name[(env->hflags & HF_LMA_MASK) ? 1 : 0] > + [(sc->flags & DESC_TYPE_MASK) > + >> DESC_TYPE_SHIFT]); > } > done: > cpu_fprintf(f, "\n"); > -- > 1.7.0 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net