[Bug 211305] devel/gdb: (CORE_ADDR) 0 missing * in cast in tui/tui-stack.c

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Aug 1 01:02:51 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211305

--- Comment #8 from Mark Millard <markmi at dsl-only.net> ---
(In reply to Mark Millard from comment #5)

For:

ada-lang.c:2489:50: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
          unpacked[unpacked_idx] = accum & ~(~0L << HOST_CHAR_BIT);
                                             ~~~ ^
ada-lang.c:2503:46: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
      unpacked[unpacked_idx] = accum & ~(~0L << HOST_CHAR_BIT);
                                         ~~~ ^

there is ( common/common-types.h ):

#ifdef GDBSERVER

/* * A byte from the program being debugged.  */
typedef unsigned char gdb_byte;

. . .

#else /* GDBSERVER */

#include "bfd.h"

/* * A byte from the program being debugged.  */
typedef bfd_byte gdb_byte;
. . .

and there is locally in ada-lang.c

  unsigned long accum;

So it appears to me that UL instead of L covers silencing this in a correct
manor, something like (used twice):

unpacked[unpacked_idx] = accum & ~(~0UL << HOST_CHAR_BIT);

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list