Message ID | orinpsx5cp.fsf@lxoliva.fsfla.org |
---|---|
State | New |
Headers | show |
On Jan 06 2017, Alexandre Oliva <aoliva@redhat.com> wrote: > On Jan 5, 2017, Andreas Schwab <schwab@linux-m68k.org> wrote: > >> On Jan 05 2017, Alexandre Oliva <aoliva@redhat.com> wrote: >>> On Jan 5, 2017, Andreas Schwab <schwab@linux-m68k.org> wrote: >>> >>>> On Jan 05 2017, Alexandre Oliva <aoliva@redhat.com> wrote: >>>>> - sprintf (xname, "<U%4x>", ((unsigned)((uintptr_t)(t) & 0xffff))); >>>>> + sprintf (xname, "<U%4hx>", ((unsigned short)((uintptr_t)(t) & 0xffff))); >>> >>>> Please fix the spacing while you are at it. >>> >>> Err... I sure would, if I knew what fix you had in mind. Care to share >>> your thoughts? Thanks, > >> Space after cast. > > Wow, thanks, I think I never got that one right. > > Here's what I'm installing, also breaking the now-too-long line: Alternatively you could remove the redundant parens. Andreas.
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 90428ca..2908669 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -2400,7 +2400,8 @@ pp_c_tree_decl_identifier (c_pretty_printer *pp, tree t) else { static char xname[8]; - sprintf (xname, "<U%4x>", ((unsigned)((uintptr_t)(t) & 0xffff))); + sprintf (xname, "<U%4hx>", ((unsigned short) ((uintptr_t) (t) + & 0xffff))); name = xname; }