[Python-Dev] PEP 296 - The Buffer Problem

Tim Peters tim@zope.com
Thu, 25 Jul 2002 11:23:05 -0400


[Thomas Heller]
> So isn't the conclusion that sizeof(size_t) == sizeof(void *) on
> any platform,

Last I knew, there were dozens of platforms besides Linux and Windows
<wink>.  Like I said, no relationship is defined here.  C99 standardizes a
uintptr_t typedef for an unsigned integer type with "enough bits" so that

    (void*)(uintptr_t)p == p

for any legit pointer p of type void*, but only standarizes its name, not
its existence (a conforming implementation isn't required to supply a
typedef with this name).  Such a type *is* required to compile Python,
though, and pyport.h defines our own Py_uintptr_t (as a synonym for the
platform uintptr_t if it exists, else to the smallest integer type it can
find that looks big enough, else a compile-time #error).

> and so the index should be of type size_t instead of
> int, long, or LONG_LONG (aka __int64 in some places)?

Try to spell out exactly what it is you think this index should be capable
of representing; e.g., what's your most extreme use case?