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 <rep...@bugs.python.org>
<http://bugs.python.org/issue22125>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to