[issue9566] Compilation warnings under x64 Windows

STINNER Victor report at bugs.python.org
Tue Jan 11 02:13:43 CET 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

... and issue9566.patch: various fixes. Interesting parts:

---
-    id = PyLong_FromLong((Py_uintptr_t) self);
+    id = PyLong_FromVoidPtr(self);
---

---
 LOCAL(PyObject*)
-expat_parse(XMLParserObject* self, char* data, int data_len, int final)
+expat_parse(XMLParserObject* self, char* data, Py_ssize_t data_len, int final)
 {
     int ok;
 
-    ok = EXPAT(Parse)(self->parser, data, data_len, final);
+    if (data_len > INT_MAX) {
+        PyErr_SetString(PyExc_OverflowError, "length doesn't fit in an int");
+        return NULL;
+    }
+
+    ok = EXPAT(Parse)(self->parser, data, (int)data_len, final);
---

---
-        long hash = PyObject_Hash(arg);
+        Py_hash_t hash = PyObject_Hash(arg);
---

----------
Added file: http://bugs.python.org/file20350/issue9566.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9566>
_______________________________________


More information about the Python-bugs-list mailing list