This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/2] Fix invalid left shift of negative value.
- From: Pedro Alves <palves at redhat dot com>
- To: Kevin Buettner <kevinb at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Dominik Vogt <vogt at linux dot vnet dot ibm dot com>
- Date: Tue, 17 Nov 2015 14:13:29 +0000
- Subject: Re: [PATCH 0/2] Fix invalid left shift of negative value.
- Authentication-results: sourceware.org; auth=none
- References: <20151110154243 dot 43d38f49 at pinnacle dot lan> <20151111172327 dot 383F51407 at oc7340732750 dot ibm dot com> <20151111122708 dot 69c496d3 at pinnacle dot lan> <20151116220950 dot 1e0f4a89 at pinnacle dot lan>
On 11/17/2015 05:09 AM, Kevin Buettner wrote:
> I came across this comment in defs.h:
>
> /* Defaults for system-wide constants (if not defined by xm.h, we fake it).
> FIXME: Assumes 2's complement arithmetic. */
>
(side note, the xm.h is gone since 2007..)
> Is this something that we really want to fix? Can anyone think of a
> host which can't run GDB (and upon which we'd like to run GDB) due the
> fact that it uses something other than the two's complement
> representation for signed integers?
Can't think of one.
> My opinion: Assumptions about two's complement in GDB should not be
> fixed. I can't think of any architecture that I'd care to use which
> uses something other than two's complement. My limited research on
> the matter shows that really archaic machines used one's complement or
> signed magnitude representations.
>
> If we all agree that this is something we don't want to fix, then I
> think we should remove that FIXME and assert somewhere that GDB is
> expected to be hosted on platforms which use two's complement
> representation for signed integers.
Agreed. If someone wants to port gdb to such a host, then we can
worry about it then.
Thanks,
Pedro Alves