This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/65331] C99 format macros doesn't accept bit fields for 64-bit integer types


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]