I recently started looking at some ctypes issues. I dug a bit into http://bugs.python.org/issue6069 and then I found http://bugs.python.org/issue11920. They both boil down to the fact that bitfield allocation is up to the compiler, which is different in GCC and MSVC. Currently we have hard-coded allocation strategy based on paltform in cfields.c:
> && *pfield_size /* we have a bitfield open */ > #ifdef MS_WIN32 > /* MSVC, GCC with -mms-bitfields */ > && dict->size * 8 == *pfield_size > #else > /* GCC */ > && dict->size * 8 <= *pfield_size > #endif > && (*pbitofs + bitsize) <= *pfield_size) { > /* continue bit field */ > fieldtype = CONT_BITFIELD; > #ifndef MS_WIN32 > } else if (bitsize /* this is a bitfield request */ > && *pfield_size /* we have a bitfield open */ > && dict->size * 8 >= *pfield_size > && (*pbitofs + bitsize) <= dict->size * 8) { > /* expand bit field */ > fieldtype = EXPAND_BITFIELD; > #endif