[issue24290] c_uint32 bitfields break structures
New submission from Rony Batista: ctypes Structures with c_uint32 bitfields have strange behaviour on OS X. In the attached code when the field "number" is set, it changes the whole 32 bits, even thou its meant to be 23 bits. The behavior is unexpected in: OS X: Python 2.7.9 The behavior is as expected in the following environments: Windows: python 2.7.9 Ubuntu: python 2.7.6 -- components: ctypes messages: 244125 nosy: Rony Batista priority: normal severity: normal status: open title: c_uint32 bitfields break structures type: behavior versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue24290> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24290] c_uint32 bitfields break structures
Rony Batista added the comment: Silly me, Heres the code. -- Added file: http://bugs.python.org/file39508/ctypesBug.py ___ Python tracker <http://bugs.python.org/issue24290> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24290] c_uint32 bitfields break structures
Rony Batista added the comment: Well, looks like the issue is with 64 bit mode then. For the first 5 cases the right answer is 69.95930480957031, and for the last 2 its -69.95930480957031. The results for the 32 bit mode are all correct. -- ___ Python tracker <http://bugs.python.org/issue24290> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com