[Bug c/83294] int32_t & related definitions wrong with -funsigned-bitfields
bugdal at aerifal dot cx
gcc-bugzilla@gcc.gnu.org
Sun Mar 11 02:01:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83294
--- Comment #4 from Rich Felker <bugdal at aerifal dot cx> ---
Further examination shows that this GCC feature (-funsigned-bitfields) is
actually buggy/non-conforming. It changes the default signedness of all integer
types in bitfields, not just plain int. This behavior seems consistent with the
documentation, but not with the C standard, which only permits it for plain
int; see C11 6.7.2 ¶5:
"Each of the comma-separated multisets designates the same type, except that
for bit-fields, it is implementation-defined whether the specifier int
designates the same type as signed int or the same type as unsigned int."
Should this be opened as a separate bug?
More information about the Gcc-bugs
mailing list