[New-bugs-announce] [issue22125] Cure signedness warnings introduced by #22003

David Wilson report at bugs.python.org
Sun Aug 3 00:11:52 CEST 2014


New submission from David Wilson:

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)

----------
components: Library (Lib)
files: cow-sign.patch
keywords: patch
messages: 224593
nosy: dw, pitrou, zach.ware
priority: normal
severity: normal
status: open
title: Cure signedness warnings introduced by #22003
type: compile error
versions: Python 3.5
Added file: http://bugs.python.org/file36217/cow-sign.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22125>
_______________________________________


More information about the New-bugs-announce mailing list