Message188688
The issue #1983 was not fixed on Windows: pid_t is HANDLE on Windows, which is a pointer. SIZEOF_PID_T is not defined in PC/pyconfig.h and so longobject.h takes the default implementation (use C long type):
/* Issue #1983: pid_t can be longer than a C long on some systems */
#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT
#define _Py_PARSE_PID "i"
#define PyLong_FromPid PyLong_FromLong
#define PyLong_AsPid PyLong_AsLong
#elif SIZEOF_PID_T == SIZEOF_LONG
...
The consequence is a compiler warning:
..\Modules\posixmodule.c(6603): warning C4244: 'function' : conversion from 'Py_intptr_t' to 'long', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj]
It would be safer to define SIZEOF_PID_T on Windows:
#define SIZEOF_PID_T SIZEOF_VOID_P
I didn't test attached patch on Windows.
Python 3.2 is affected, but I don't think that the issue is important enough to touch this branch (which now only accept security fixes).
See also issue #17870. |
|
Date |
User |
Action |
Args |
2013-05-07 22:11:49 | vstinner | set | recipients:
+ vstinner, tim.golden, serhiy.storchaka |
2013-05-07 22:11:49 | vstinner | set | messageid: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> |
2013-05-07 22:11:49 | vstinner | link | issue17931 messages |
2013-05-07 22:11:49 | vstinner | create | |
|