Vlad Riscutia <riscutiav...@gmail.com> added the comment:

I agree compiler matters for alignment but if you look at PyCField_FromDesc, 
you will see the layout is pretty much #ifdef MS_WIN32 - #else.

Sorry for generalizing, "all" indeed is not the right word. My point is that we 
should set expectation correctly - VC++-style on Windows, GCC-style everywhere 
else and encourage users to access structure members by name, not raw memory. 
Issues opened for bitfields *usually* are of the form I mentioned - setting raw 
memory to some bytes then seeing members are not what user expected, even if 
ctypes algorithm works correctly.

As I said, I will revise the patch and maybe make it more clear that users 
should look up how bitfield allocation works for their compiler instead of 
trying to understand this via structure raw memory.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12880>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to