[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

Charles Machalow report at bugs.python.org
Thu Nov 16 23:49:13 EST 2017


Charles Machalow <csm10495 at gmail.com> added the comment:

Antti, is there a place in the ctypes documentation that explicitly says ctypes is not meant to be used cross-platform? If not, shouldn't that be mentioned?

I think ultimately ctypes should default to standard OS/compiler behavior, but should allow the flexibility for one to override for cross-platform interchangeability.

In the C++ code here, the code is explicitly checking if Windows (or GCC) to choose behavior. In theory, that could be changed to allow runtime-choice for packing behavior. 

Of course, that is probably best for a feature issue. For this one, I'd just like to have the behavior on Linux match GCC, as that is the definitive bug here as our example has shown.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29753>
_______________________________________


More information about the Python-bugs-list mailing list