This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] avoid strange arithmetic with strings in i386-dis.c


On Thu, Oct 10, 2013 at 4:15 PM, Roland McGrath <mcgrathr@google.com> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]