On 8/21/06, Thomas Wouters <thomas at python.org> 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4