From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2119 invoked by alias); 11 Oct 2013 00:12:37 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 2108 invoked by uid 89); 11 Oct 2013 00:12:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f172.google.com Received: from mail-ob0-f172.google.com (HELO mail-ob0-f172.google.com) (209.85.214.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 11 Oct 2013 00:12:36 +0000 Received: by mail-ob0-f172.google.com with SMTP id vb8so2274866obc.31 for ; Thu, 10 Oct 2013 17:12:34 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.131.197 with SMTP id oo5mr7663012oeb.39.1381450354477; Thu, 10 Oct 2013 17:12:34 -0700 (PDT) Received: by 10.76.75.71 with HTTP; Thu, 10 Oct 2013 17:12:34 -0700 (PDT) In-Reply-To: References: Date: Fri, 11 Oct 2013 00:12:00 -0000 Message-ID: Subject: Re: [PATCH] avoid strange arithmetic with strings in i386-dis.c From: "H.J. Lu" To: Roland McGrath Cc: "binutils@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00149.txt.bz2 On Thu, Oct 10, 2013 at 4:15 PM, Roland McGrath wrote: > This makes the code a bit less baroque, and also avoids warnings from some > compilers. After the various changes I've committed in the last couple of > days, this is enough to get binutils (excluding gold) to build warning-free > with a recent Clang. > > OK for trunk and 2.24? > > Thanks, > Roland > > > opcodes/ > * i386-dis.c (oappend_maybe_intel): New function. > (OP_ST, OP_STi, append_seg, OP_I, OP_I64, OP_sI, OP_ESreg): Use it. > (OP_C, OP_T, CMP_Fixup, OP_EX_VexImmW): Likewise. > (VCMP_Fixup, VPCMP_Fixup, PCLMUL_Fixup): Likewise. > > --- a/opcodes/i386-dis.c > +++ b/opcodes/i386-dis.c > @@ -1,6 +1,6 @@ > /* Print i386 instructions for GDB, the GNU debugger. > Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, > - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 > + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 > Free Software Foundation, Inc. > > This file is part of the GNU opcodes library. > @@ -13095,17 +13095,27 @@ dofloat (int sizeflag) > } > } > > +/* Like oappend (below), but S is a string starting with '%'. > + In Intel syntax, the '%' is elided. */ > +static void > +oappend_maybe_intel (const char *s) > +{ > + if (intel_syntax) > + ++s; > + oappend (s); > +} > + Please use oappend (s + intel_syntax); instead. OK for trunk with this change. Thanks. -- H.J.