[issue29753] [Linux] ctypes packs bitfields Incorrectly

2021-07-11 Thread Sam Price
Sam Price added the comment: I’ve been looking forward to this fix. The old implementation did not match what my LLVM compiler generated. On Sun, Jul 11, 2021 at 2:52 PM Charles Machalow wrote: > > Charles Machalow added the comment: > > Maybe we need to add a __packing

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2020-03-05 Thread Sam Price
Sam Price added the comment: I ran into this bug on mac and submitted a duplicate issue of 39858 If you add the check *pfield_size != *pbitofs it fixes this bug. #ifndef MS_WIN32 } else if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfi

[issue39858] bitfield layout wrong in ctypes

2020-03-05 Thread Sam Price
Sam Price added the comment: Does not happen on windows. Error is in cfield.c ``` #ifndef MS_WIN32 } else if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfield open */ && dict->size * 8 >= *pfield_size &&

[issue39858] bitfield layout wrong in ctypes

2020-03-04 Thread Sam Price
New submission from Sam Price : 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