[Python-checkins] r42504 - python/trunk/Python/getargs.c

Thomas Wouters thomas at xs4all.net
Sun Feb 19 22:11:50 CET 2006


On Sun, Feb 19, 2006 at 12:19:43PM -0800, Neal Norwitz wrote:

> > However, using %ld and casting the Py_ssize_t to a long isn't going to
> > work on Win64, I believe. It won't work any worse than the previous %d,
> > though.

> Won't work in what sense?

> I don't think there was a bug in the code, beyond the warning.  Will
> the code I just fixed cause a warning on Win64?  I believe it won't
> generate a warning on 32-bit systems.

Py_ssize_t (and size_t, and any ptr-type) on Win64 are 64 bit, but ints and
longs are only 32 bit. Fortunately, Win64 is little-endian, so it *should*
just print right up to 2147483648. I think. :) Not that I have first-hand
knowledge of this; all my 64-bit machines run Linux.

> >  The best solution would be to have PyOS_snprintf() convert %zd to

> You forgot to quote best, ie, "best". :-)

Yeah, I dunno what I was thinking. The 'really best' solution would be to
get Microsoft and every other compiler in the world to finally implement
%zd. :)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!


More information about the Python-checkins mailing list