[PATCH 0/2] Fix invalid left shift of negative value.

Paul_Koning@Dell.com Paul_Koning@Dell.com
Tue Nov 17 17:33:00 GMT 2015


> On Nov 17, 2015, at 9:13 AM, Pedro Alves <palves@redhat.com> wrote:
> 
> On 11/17/2015 05:09 AM, Kevin Buettner wrote:
> 
>> ...
>> 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.

Agreed.  One's complement is seriously obsolete.  I can't think of any architecture in current use (in actual hardware) that uses it.  You can of course easily find any number of examples supported in simulators like SIMH, but that isn't significant.  None of those are likely to become GDB targets.

>> 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.

I remember reading a claim that C requires two's complement (at least ANSI C), so it's not likely that this will ever happen, and if it does, GDB will be the least of the port developer's worries.

	paul



More information about the Gdb-patches mailing list