This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hfuru
Recipients hfuru, theller
Date 2010-11-05.08:38:05
SpamBayes Score 1.7840484e-05
Marked as misclassified No
Message-id <1288946289.37.0.37131892978.issue10320@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-11-05 08:38:09hfurusetrecipients: + hfuru, theller
2010-11-05 08:38:09hfurusetmessageid: <1288946289.37.0.37131892978.issue10320@psf.upfronthosting.co.za>
2010-11-05 08:38:06hfurulinkissue10320 messages
2010-11-05 08:38:05hfurucreate