Hello Paul,
> This prints "513 0.0" rather than the correct "513 1.0".
Indeed. I reproduce on Solaris 10/SPARC. On Solaris 10/x86, the result is
simply a SIGSEGV.
When I build a testdir for 'snprintf-posix', the results are:
- On Solaris 10/x86:
checking whether printf supports l
Paul Eggert 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
> int
> main (void)
> {
> char buf[1000];
> int n = snprintf (buf, sizeof buf, "%.511f", 1.0);
> printf ("%d %s\n", n, buf);
".
>From 1c90a6dffb9b96d79188bee2924765d1ff8ce034 Mon Sep 17 00:00:00 2001
From: Paul Eggert
Date: Wed, 22 Dec 2010 15:13:59 -0800
Subject: [PATCH] doc: document Solaris printf bug with large float precisions
* doc/posix-functions/dprintf.texi (dprintf):
* doc/posix-functions/fp