This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vladris
Recipients docs@python, meador.inge, terry.reedy, vladris
Date 2011-10-04.18:39:26
SpamBayes Score 3.2030222e-08
Marked as misclassified No
Message-id <1317753567.25.0.786594630469.issue12880@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-10-04 18:39:27vladrissetrecipients: + vladris, terry.reedy, meador.inge, docs@python
2011-10-04 18:39:27vladrissetmessageid: <1317753567.25.0.786594630469.issue12880@psf.upfronthosting.co.za>
2011-10-04 18:39:26vladrislinkissue12880 messages
2011-10-04 18:39:26vladriscreate