qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-i386: Fix compiler warning
@ 2010-04-01 18:03 Stefan Weil
  2010-04-08 19:43 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2010-04-01 18:03 UTC (permalink / raw)
  To: QEMU Developers

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 <weil@mail.berlios.de>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] target-i386: Fix compiler warning
  2010-04-01 18:03 [Qemu-devel] [PATCH] target-i386: Fix compiler warning Stefan Weil
@ 2010-04-08 19:43 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2010-04-08 19:43 UTC (permalink / raw)
  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 <weil@mail.berlios.de>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-08 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 18:03 [Qemu-devel] [PATCH] target-i386: Fix compiler warning Stefan Weil
2010-04-08 19:43 ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).