stdint.h defines PRIx16 and similar in unhelful way

Bug #1036859 reported by Kevin O'Gorman
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

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.

Tags: bot-comment
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

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

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1036859/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote : Re: [Bug 1036859]

I have already added a comment to the bug, listing the package as
libc6-dev. I'll also follow the link in case that "official" way is
more helpful.

On Tue, Aug 14, 2012 at 5:23 PM, Ubuntu Foundation's Bug Bot
<email address hidden> wrote:
> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. It seems that your bug report is not filed about a
> specific source package though, rather it is just filed against Ubuntu
> in general. It is important that bug reports be filed about source
> packages so that people interested in the package can find the bugs
> about it. You can find some hints about determining what package your
> bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage.
> You might also ask for help in the #ubuntu-bugs irc channel on Freenode.
>
> To change the source package that this bug is filed about visit
> https://bugs.launchpad.net/ubuntu/+bug/1036859/+editstatus and add the
> package name in the text box next to the word Package.
>
> [This is an automated message. I apologize if it reached you
> inappropriately; please just reply to this message indicating so.]
>
> ** Tags added: bot-comment
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1036859
>
> Title:
> stdint.h defines PRIx16 and similar in unhelful way
>
> Status in Ubuntu:
> New
>
> Bug description:
> 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.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+bug/1036859/+subscriptions

--
Kevin O'Gorman, PhD

affects: ubuntu → eglibc (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in eglibc (Ubuntu):
status: New → Confirmed
Revision history for this message
Ralph Corderoy (ralph-inputplus) wrote :

This bug, PRIx16 is "x" rather than "hx", reported 2012-08, has just bit me.
Is Ubuntu now doing a disservice to the community by still accepting bug reports, but acting as a "nothing happens" sink for them with more chance of a fix if they were reported upstream in the first place?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.