[issue10310] signed:1 bitfields rarely make sense
Changes by Berker Peksag berker.pek...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed versions: +Python 3.5 -Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10310] signed:1 bitfields rarely make sense
Mark Lawrence added the comment: Could we have a patch review on this please. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10310] signed:1 bitfields rarely make sense
Roundup Robot added the comment: New changeset 3aeca1fd4c0e by Victor Stinner in branch 'default': Issue #10310: Use unsigned int field:1 instead of signed int field:1 in a http://hg.python.org/cpython/rev/3aeca1fd4c0e -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10310] signed:1 bitfields rarely make sense
New submission from Hallvard B Furuseth h.b.furus...@usit.uio.no: In Python 2.7 and 3.2a3, Modules/_io/textio.c uses signed:1 bitfields. They have value -1 or 0 in two's complement, but are not used thus here: gcc complains of bitfield = 1 overflow. If the point was that they are assigned signed values, well, unsigned:1 is promoted to signed int. I also fix a strange (int) cast doing (truncate flag to int) 1. My guess is someone shut up a compiler warning about the above, by cleaning up in the wrong place. I kept a cast in case that's not it, and some compiler would get noisy anyway. There are possibly-signed 1-bit fields Modules/_ctypes/_ctypes_test.c: struct BITS too, but I don't know what that code is for. It does not specify signedness of the bitfields, which (as with char) makes it the compiler's choice. That's usually a bad idea, but maybe that code is for exploring the compiler? -- components: IO files: signed-1-bitfield.diff keywords: patch messages: 120392 nosy: hfuru priority: normal severity: normal status: open title: signed:1 bitfields rarely make sense type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file19487/signed-1-bitfield.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10310] signed:1 bitfields rarely make sense
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10310] signed:1 bitfields rarely make sense
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +amaury.forgeotdarc stage: - patch review versions: +Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10310 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com