Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Aug 2016 01:02:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 211305] devel/gdb: (CORE_ADDR) 0 missing * in cast in tui/tui-stack.c
Message-ID:  <bug-211305-13-UHfsrF8NTZ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-211305-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-211305-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211305

--- Comment #8 from Mark Millard <markmi@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] =3D accum & ~(~0L << HOST_CHAR_BIT);
                                             ~~~ ^
ada-lang.c:2503:46: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
      unpacked[unpacked_idx] =3D 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] =3D accum & ~(~0UL << HOST_CHAR_BIT);

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-211305-13-UHfsrF8NTZ>