From patchwork Fri Apr 9 20:49:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 49866 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by ozlabs.org (Postfix) with ESMTP id B5F4EB7CF8 for ; Sat, 10 Apr 2010 06:59:29 +1000 (EST) Received: from localhost ([127.0.0.1]:59270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0LCW-00012A-R3 for incoming@patchwork.ozlabs.org; Fri, 09 Apr 2010 16:53:16 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0LC6-00011v-FO for qemu-devel@nongnu.org; Fri, 09 Apr 2010 16:52:50 -0400 Received: from [140.186.70.92] (port=43296 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0LA0-0000XS-76 for qemu-devel@nongnu.org; Fri, 09 Apr 2010 16:52:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0L9M-0002uh-8f for qemu-devel@nongnu.org; Fri, 09 Apr 2010 16:50:06 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:53858) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0L9L-0002uU-UD for qemu-devel@nongnu.org; Fri, 09 Apr 2010 16:50:00 -0400 Received: from flocke.weilnetz.de (p54ADF948.dip.t-dialin.net [84.173.249.72]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LhRY4-1NDp2M3njU-00meHf; Fri, 09 Apr 2010 22:49:59 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.71) (envelope-from ) id 1O0L9K-0001U5-25; Fri, 09 Apr 2010 22:49:58 +0200 From: Stefan Weil To: QEMU Developers Date: Fri, 9 Apr 2010 22:49:51 +0200 Message-Id: <1270846193-5667-3-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1270846193-5667-1-git-send-email-weil@mail.berlios.de> References: <1270846193-5667-1-git-send-email-weil@mail.berlios.de> X-Provags-ID: V01U2FsdGVkX19LsNstIWz+EkYWiE7dRt9SG6zYEv5sXKjue3m z2jYY2flyih4T9B7+Zofik2qS9kFli/6AWH/cwkALc0bK/MPdm 6w0jlJk5LZWjwMxauXHM5VDhyiSn3kHfOUCMAD2XBf8CuPVVOM ULA== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] m68k: Fix compiler warning (fprintf format string) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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. */