[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] doc: document Solaris printf bug with large float precisions
From: |
Simon Josefsson |
Subject: |
Re: [PATCH] doc: document Solaris printf bug with large float precisions |
Date: |
Fri, 24 Dec 2010 09:54:35 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) |
Paul Eggert <address@hidden> writes:
> Here's a simpler test case that illustrates the Solaris bug,
> in case there's anybody here who can get bug fixes
> into Solaris:
>
> #include <stdio.h>
> int
> main (void)
> {
> char buf[1000];
> int n = snprintf (buf, sizeof buf, "%.511f", 1.0);
> printf ("%d %s\n", n, buf);
> return 0;
> }
>
> This prints "513 0.0...." rather than the correct "513 1.0....".
Wouldn't it make sense to add a self-test for this, which would fail on
all other platforms, but on Solaris, return -77 to cause a SKIP?
Possibly also print a message with a link to this thread. That way,
people building on Solaris will notice the issue and someone may
eventually get it fixed upstream.
If there are no objections, I'll write up a self-test.
/Simon