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 mark.dickinson
Recipients mark.dickinson, meador.inge
Date 2012-06-21.17:30:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340299804.63.0.65303748456.issue15119@psf.upfronthosting.co.za>
In-reply-to
Content
There are two separate issues here.  The first is that the layout that ctypes chooses for a struct of bitfields fails basic sanity checks, like having each bitfield actually fit in the corresponding type.  As a result, the C-level bitshifting code used to get bitfields ends up invoking undefined behaviour.

A secondary problem is that the ctypes layout doesn't match what the compiler does, at least for the system supplied gcc (4.2) on OS X 10.6.

The attached patch fixes the first issue, but not the second.
History
Date User Action Args
2012-06-21 17:30:05mark.dickinsonsetrecipients: + mark.dickinson, meador.inge
2012-06-21 17:30:04mark.dickinsonsetmessageid: <1340299804.63.0.65303748456.issue15119@psf.upfronthosting.co.za>
2012-06-21 17:30:03mark.dickinsonlinkissue15119 messages
2012-06-21 17:30:03mark.dickinsoncreate