On 8/21/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: [snip] > > Is this a bug? [snap] > Yes. Py_ssize_t can be bigger than a long (on LLP64 systems, such as Win64).
Here is a similar problem: typedef struct { ... size_t pos; ... } mmap_object; ... mmap_tell_method(mmap_object *self, PyObject *unused) { CHECK_VALID(NULL); return PyInt_FromLong((long) self->pos); } See Modules/mmapmodule.c . Here a cast to ssize_t would, technically speaking, not be safe either, but it may be worth using ssize_t anyways. Is there a simple automated way to detect situations like this? Maybe there is a win64 compiler that would generate a warning. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com