Message32782
[Tim Peters]
> [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>.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:59:33 | admin | link | issue400523 messages |
2007-08-23 14:59:33 | admin | create | |
|