qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] m68k: Fix compiler warning (fprintf format string)
Date: Fri,  9 Apr 2010 22:49:51 +0200	[thread overview]
Message-ID: <1270846193-5667-3-git-send-email-weil@mail.berlios.de> (raw)
In-Reply-To: <1270846193-5667-1-git-send-email-weil@mail.berlios.de>

When argument checking is enabled, gcc throws this error:

error: format not a string literal and no format arguments

The patch rewrites the statement to satisfy the compiler.
It also removes a type cast which is not needed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 m68k-dis.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/m68k-dis.c b/m68k-dis.c
index d38d5a2..7cd88f8 100644
--- a/m68k-dis.c
+++ b/m68k-dis.c
@@ -1104,7 +1104,7 @@ print_insn_arg (const char *d,
       {
         static const char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" };
         val = fetch_arg (buffer, place, 2, info);
-        (*info->fprintf_func) (info->stream, cacheFieldName[val]);
+        (*info->fprintf_func) (info->stream, "%s", cacheFieldName[val]);
         break;
       }
 
@@ -1199,7 +1199,7 @@ print_insn_arg (const char *d,
 	{
 	  static const char *const scalefactor_name[] = { "<<", ">>" };
 	  val = fetch_arg (buffer, place, 1, info);
-	  (*info->fprintf_func) (info->stream, scalefactor_name[val]);
+	  (*info->fprintf_func) (info->stream, "%s", scalefactor_name[val]);
 	}
       else
 	{
@@ -1804,7 +1804,7 @@ match_insn_m68k (bfd_vma memaddr,
 
   save_p = p;
   info->print_address_func = dummy_print_address;
-  info->fprintf_func = (fprintf_ftype) dummy_printer;
+  info->fprintf_func = dummy_printer;
 
   /* We scan the operands twice.  The first time we don't print anything,
      but look for errors.  */
-- 
1.5.6.5

  parent reply	other threads:[~2010-04-09 20:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 20:49 [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Stefan Weil
2010-04-09 20:49 ` [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string) Stefan Weil
2010-04-13 22:16   ` Aurelien Jarno
2010-04-09 20:49 ` Stefan Weil [this message]
2010-04-13 22:17   ` [Qemu-devel] [PATCH] m68k: " Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sh4: " Stefan Weil
2010-04-13 22:17   ` Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sparc: " Stefan Weil
2010-04-13 22:17   ` Aurelien Jarno
2010-04-10 11:44 ` [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1270846193-5667-3-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).