[Patches] simple 64-bit fixes in Python/ dir

Tim Peters tim_one@email.msn.com
Mon, 5 Jun 2000 21:30:33 -0400


[posted & mailed]

[Trent Mick]
> ...
> On 64-bit platforms sizeof(int) < sizeof(size_t), so
> using size_t avoids a downcast warning (or overflow).

I suppose we should be more careful about explaining the need for these
changes.  For example, the claim above isn't true, as there are 64-bit
platforms where sizeof(int) == sizeof(size_t) too (the Cray J90 is one such
platform Python kind of <wink> runs on today, and indeed even shorts are 64
bits on that one).

The problems here are that Python implicitly assumes sizeof(int) ==
sizeof(size_t), because at the time Python was written size_t didn't exist
and the long K&R tradition preceding ANSI C was that strlen returned an
int-sized thing and malloc took one.  So they're all in the nature of
cleaning up after the C committee a decade later <wink>.