Author vladris
Recipients docs@python, meador.inge, terry.reedy, vladris
Date 2011-10-04.18:39:26
SpamBayes Score 3.20302e-08
Marked as misclassified No
Message-id <>
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.
Date User Action Args
2011-10-04 18:39:27vladrissetrecipients: + vladris, terry.reedy, meador.inge, docs@python
2011-10-04 18:39:27vladrissetmessageid: <>
2011-10-04 18:39:26vladrislinkissue12880 messages
2011-10-04 18:39:26vladriscreate