A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-August/068488.html below:

[Python-Dev] gcc 4.2 exposes signed integer overflows

[Python-Dev] gcc 4.2 exposes signed integer overflows [Python-Dev] gcc 4.2 exposes signed integer overflowsDavid Hopwood david.nospam.hopwood at blueyonder.co.uk
Sun Aug 27 03:18:37 CEST 2006
Thomas Wouters wrote:
> On 8/26/06, David Hopwood <david.nospam.hopwood at blueyonder.co.uk> wrote:
> 
>> CPython should be fixed anyway. The correct fix is
>> "if (y == -1 && x < 0 && (unsigned long)x == -(unsigned long)x)".
> 
> Why not just "... && x == LONG_MIN"?

Because the intent is to check that x / y does not overflow a long, and
x == LONG_MIN would not cause an overflow on 1's complement or sign-magnitude
systems.

(CPython has probably only been tested on 2's complement systems anyway,
but if we're going to be pedantic about depending only on things in the
C standard...)

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4