[issue3547] Ctypes is confused by bitfields of varying integer types
Matt Giuca
report at bugs.python.org
Sat Aug 16 07:56:41 CEST 2008
Matt Giuca <matt.giuca at gmail.com> added the comment:
Confirmed in HEAD for Python 2.6 and 3.0, on Linux.
Python 2.6b2+ (trunk:65708, Aug 16 2008, 15:04:13)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Python 3.0b2+ (py3k:65708, Aug 16 2008, 15:09:19)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
I was also able to simplify the test case. I get this issue just using
one c_short and one c_long, with nonstandard bit lengths. eg:
fields = [('a', c_short, 16), ('b', c_long, 16)]
(sizeof(c_short) == 2 and sizeof(c_long) == 4).
But it's somewhat sporadic under which conditions it happens and which
it doesn't.
One might imagine this was a simple calculation. But the _ctypes module
is so big (5000 lines of C); at an initial glance I can't find the code
responsible! Any hints? (Modules/_ctypes/ctypes.c presumably is where
this takes place).
----------
nosy: +mgiuca
versions: +Python 2.6, Python 3.0
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3547>
_______________________________________
More information about the Python-bugs-list
mailing list