The C standard leaves it up to the implementation to determine the sign of bit fields when left unspecified. Python assumes the compiler will default to signed; however, this is not the case for Solaris and AIX. Therefore, we should explicitly declare the sign of bit fields where applicable. --- a/Modules/_ctypes/_ctypes_test.c +++ b/Modules/_ctypes/_ctypes_test.c @@ -370,8 +370,8 @@ EXPORT(unsigned PY_LONG_LONG) last_tf_arg_u; struct BITS { - int A: 1, B:2, C:3, D:4, E: 5, F: 6, G: 7, H: 8, I: 9; - short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7; + signed int A: 1, B:2, C:3, D:4, E: 5, F: 6, G: 7, H: 8, I: 9; + signed M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7; }; EXPORT(void) set_bitfields(struct BITS *bits, char name, int value)