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 thesamprice
Recipients thesamprice
Date 2020-03-05.05:22:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583385756.4.0.955468761993.issue39858@roundup.psfhosted.org>
In-reply-to
Content
if 8 1 byte fields are included in a ctype field, it allows an extra byte to be included in the packing when there is no room left for the next field.

If I put the bitfields in a child structure then I get expected results.
 
In [35]: run ctypeSizeTest.py
Size is  4 Expected 3
0 0x10000 a0
0 0x10001 a1
0 0x10002 a2
0 0x10003 a3
0 0x10004 a4
0 0x10005 a5
0 0x10006 a6
0 0x10007 a7
0 0x40008 b0 <- Expected to be at offset 1, not 0.
2 0xc0000 b1 <- Expected to be at offset 1, not 2
Size is  3 Expected 3
0 0x1 a
1 0x40000 b0
1 0xc0004 b1
History
Date User Action Args
2020-03-05 05:22:36thesampricesetrecipients: + thesamprice
2020-03-05 05:22:36thesampricesetmessageid: <1583385756.4.0.955468761993.issue39858@roundup.psfhosted.org>
2020-03-05 05:22:35thesampricelinkissue39858 messages
2020-03-05 05:22:35thesampricecreate