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 dw
Recipients dw, pitrou, zach.ware
Date 2014-08-02.22:11:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407017512.42.0.779686467966.issue22125@psf.upfronthosting.co.za>
In-reply-to
Content
The attached patch (hopefully) silences the signedness warnings generated by Visual Studio and reported on python-dev in <https://mail.python.org/pipermail/python-dev/2014-July/135603.html>. 

This was sloppiness on my part, I even noted the problem in the original ticket and never fixed it. :)

I don't have a local dev environment setup for MSVC and Python, but at least the attached patch cures the signedness errors on Clang. They don't seem to occur at all with GCC on my Mac.

The added casts ensure comparisons uniformly compare in the unsigned domain. It seems "size_t buf_size" is pretty redundant in the original struct, it just introduces lots of casting when it only appears to be required during write_bytes() to avoid signed overflow (undefined behaviour)
History
Date User Action Args
2014-08-02 22:11:52dwsetrecipients: + dw, pitrou, zach.ware
2014-08-02 22:11:52dwsetmessageid: <1407017512.42.0.779686467966.issue22125@psf.upfronthosting.co.za>
2014-08-02 22:11:52dwlinkissue22125 messages
2014-08-02 22:11:51dwcreate