stdint.h defines PRIx16 and similar in unhelful way
Bug #1036859 reported by
Kevin O'Gorman
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Ubuntu 11.04
reference: http://
inttypes.h defines macros for fixed integer types. The ones for 8- and 16-bit types are currently the same as the 32-bit types, which pretty much makes them useless.
PRIx16 is x I suggest it should be hx
PRIx8 is x I suggest it should be hhx
Otherwise, only by excruciatingly correct typecasting in the printf can you get the correct output for something like
int16_t this = -1;
printf("%" PRIx16 "\n", this);
As it stands, it will print 8 hex digits. It makes more sense for it to print 4.
To post a comment you must log in.
I guess I should have named the package too: libc6-dev.
This is still an issue in 12.04, at package level 2.15-0ubuntu10