[Python-Dev] Before 2.5 - More signed integer overflows

Armin Rigo arigo at tunes.org
Sat Sep 16 13:11:11 CEST 2006

Hi all,

There are more cases of signed integer overflows in the CPython source
code base...

That's on a 64-bits machine:

    [GCC 4.1.2 20060715 (prerelease) (Debian 4.1.1-9)] on linux2
    abs(-sys.maxint-1) == -sys.maxint-1

I'd expect the same breakage everywhere when GCC 4.2 is used.  Note that
the above is Python 2.4.4c0 - apparently Python 2.3 compiled with GCC
4.1.2 works, although that doesn't make much sense to me because
intobject.c didn't change here - 2.3, 2.4, 2.5, trunk are all the same.
Both tested Pythons are Debian packages, not in-house compiled.

Humpf!  Looks like one person or two need to do a quick last-minute
review of all places trying to deal with -sys.maxint-1, and replace them
all with the "official" fix from Tim [SF 1545668].

A bientot,


More information about the Python-Dev mailing list