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 loewis
Recipients effbot, flox, janglin, loewis, pitrou
Date 2010-09-24.18:32:12
SpamBayes Score 4.690882e-07
Marked as misclassified No
Message-id <4C9CEEAB.9080500@v.loewis.de>
In-reply-to <1285293633.89.0.14013025074.issue9783@psf.upfronthosting.co.za>
Content
> issue9783.diff provides a patch that will compile clean on 32 and 64
> bit Windows systems.  I tried to avoid explicit casts where I could,
> but it was not always possible. I have ported a lot of my company's
> code to 64 bit (all Windows based).  In my experience many warnings
> are because of programmers using the int type in places where a
> size_t may be more appropriate. Most of the warnings here are due to
> mixing int and Py_ssize_t types.

I think the patch is incorrect as it stands: the casts may cause
truncation. As you say, int is still being used where size_t was
more appropriate, so I think we should change it in that manner
(e.g. make element_resize accept Py_ssize_t).

In cases where we really can't propagate Py_ssize_t to (e.g.
XML_Parse), we need to check for an int overflow, and raise
an exception if it does overflow.
History
Date User Action Args
2010-09-24 18:32:14loewissetrecipients: + loewis, effbot, pitrou, janglin, flox
2010-09-24 18:32:12loewislinkissue9783 messages
2010-09-24 18:32:12loewiscreate