New submission from Hallvard B Furuseth <h.b.furus...@usit.uio.no>: Modules/_ctypes/callproc.c:PyCArg_repr() uses sprintf(%qd, long long), which is a GNU (and more?) extension. ISO C99 says %lld.
Instead, use "%" PY_FORMAT_LONG_LONG "d" from pyconfig.h/pyport.h. Kills off #ifdef MS_WIN32 too. If Python must support C libraries that handle %qd but not %lld, configure.in seems the right place. Index: ./Modules/_ctypes/callproc.c @@ -468,8 +468,3 @@ PyCArg_repr(PyCArgObject *self) case 'Q': - sprintf(buffer, -#ifdef MS_WIN32 - "<cparam '%c' (%I64d)>", -#else - "<cparam '%c' (%qd)>", -#endif + sprintf(buffer, "<cparam '%c' (%" PY_FORMAT_LONG_LONG "d)>", self->tag, self->value.q); pyport.h tests (defined(MS_WIN64) || defined(MS_WINDOWS)) instead of #ifdef MS_WIN32 for when to use %I64d. I assume that's more up to date. ---------- assignee: theller components: ctypes messages: 120473 nosy: hfuru, theller priority: normal severity: normal status: open title: printf %qd is nonstandard type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10320> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com