From e5c15efff67d0cda978d726a11e5996a88f29b6f Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 1 Apr 2010 20:03:30 +0200 Subject: [PATCH] target-i386: Fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Stefan Weil Signed-off-by: Aurelien Jarno --- target-i386/helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index 35ab72090a..3835835103 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"); -- 2.11.0