From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1oPq-0003BO-OA for qemu-devel@nongnu.org; Tue, 13 Apr 2010 18:17:06 -0400 Received: from [140.186.70.92] (port=36930 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1oPp-0003Ah-56 for qemu-devel@nongnu.org; Tue, 13 Apr 2010 18:17:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1oPn-0005xq-Io for qemu-devel@nongnu.org; Tue, 13 Apr 2010 18:17:05 -0400 Received: from hall.aurel32.net ([88.191.82.174]:49557) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1oPn-0005xl-BZ for qemu-devel@nongnu.org; Tue, 13 Apr 2010 18:17:03 -0400 Date: Wed, 14 Apr 2010 00:17:01 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] m68k: Fix compiler warning (fprintf format string) Message-ID: <20100413221701.GF24116@volta.aurel32.net> References: <1270846193-5667-1-git-send-email-weil@mail.berlios.de> <1270846193-5667-3-git-send-email-weil@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1270846193-5667-3-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 Fri, Apr 09, 2010 at 10:49:51PM +0200, Stefan Weil wrote: > 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 Thanks, applied. > --- > 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 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net