[Python-Dev] gcc 4.2 exposes signed integer overflows (original) (raw)

Armin Rigo arigo at tunes.org
Tue Aug 29 22:10:22 CEST 2006


Hi Tim,

On Sat, Aug 26, 2006 at 08:37:46PM -0400, Tim Peters wrote:

[Thomas Wouters] > Why not just "... && x == LONGMIN"?

it's better (when possible) not to tie the code to that x was specifically declared as type "long" (e.g., just more stuff that will break if Python decides to make its short int of type PYLONGLONG instead).

The proposed "correct fix" breaks this goal too:

>> "if (y == -1 && x < 0 && (unsigned long)x == -(unsigned long)x)".

                           ^^^^^^^^^^^^^        ^^^^^^^^^^^^^

A bientot,

Armin



More information about the Python-Dev mailing list