[Bug 1036859] [NEW] stdint.h defines PRIx16 and similar in unhelful way

Launchpad Bug Tracker 1036859 at bugs.launchpad.net
Wed Aug 15 13:39:57 UTC 2012


You have been subscribed to a public bug:

Ubuntu 11.04
reference: http://pubs.opengroup.org/onlinepubs/007904975/basedefs/inttypes.h.html

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.

** Affects: eglibc (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: bot-comment
-- 
stdint.h defines PRIx16 and similar in unhelful way
https://bugs.launchpad.net/bugs/1036859
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to eglibc in Ubuntu.




More information about the foundations-bugs mailing list