[Bug c/65331] C99 format macros doesn't accept bit fields for 64-bit integer types
dmitry.petroff at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Mar 6 14:00:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65331
--- Comment #1 from Dmitry Petrov <dmitry.petroff at gmail dot com> ---
UPD: it appears that bug doesn't related to PRI* format specifiers:
-m64:
printf("%lu\n", value); // usigned long value:31 => error (ok)
printf("%lu\n", value); // usigned long value:33 => error (not ok IMHO)
-m32
printf("%lu\n", value); // usigned long long value:31 => compiles (ok)
printf("%llu\n", value); // usigned long long value:33 => error (not ok IMHO)
It seems that bit fields wider than 32 bits are'n treated as 64 bit integers
and need an explicit cast while fields of 32 bits width and less are propagated
to 32-bit integer type (int/unsigned int) and work just fine.
More information about the Gcc-bugs
mailing list