Opened 20 months ago

Closed 20 months ago

Last modified 20 months ago

#18353 closed bug (fixed)

swprintf produces wrong output for hexadecimal floating-point numbers

Reported by: bhaible Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: System/POSIX Version: R1/beta4
Keywords: r1beta4-fixes Cc:
Blocked By: Blocking:
Platform: x86-64

Description

Haiku r1beta4, on x86_64, produces wrong output in swprintf directives that shall print long doubles in hexadecimal format.

POSIX https://pubs.opengroup.org/onlinepubs/9699919799/functions/swprintf.html describes the 'a' directive for swprintf.

How to reproduce:

$ gcc -Wall -ggdb foo.c
$ ./a.out

Expected output:

ret = 9 result=0xc.91p-2
ret = 9 result=0xc.91p-2

Actual output:

ret = 9 result=0xc.91p-2
ret = 9 result=0xc.c9p-2

Attachments (1)

foo.c (385 bytes ) - added by bhaible 20 months ago.
test case

Download all attachments as: .zip

Change History (6)

by bhaible, 20 months ago

Attachment: foo.c added

test case

comment:1 by bhaible, 20 months ago

This bug also existed in glibc 2.15. It is fixed in glibc 2.17 and newer. The fix was probably the commit a9f8e53a5b14ba481999ded036b025554ea06362 by Joseph Myers (2012-09-24).

comment:2 by korli, 20 months ago

Milestone: UnscheduledR1/beta5
Platform: Allx86-64
Resolution: fixed
Status: newclosed

comment:3 by kallisti5, 20 months ago

Milestone: R1/beta5R1/beta4

cherry-picked to r1beta4 too. Expect the next system update to include this.

comment:4 by pulkomandy, 20 months ago

Milestone: R1/beta4R1/beta5

comment:5 by pulkomandy, 20 months ago

Keywords: r1beta4-fixes added
Note: See TracTickets for help on using tickets.