mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: printf POSIX compliance
Date: Fri, 8 Jun 2012 10:44:23 -0400	[thread overview]
Message-ID: <20120608144423.GN163@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAOnWdoihoSttjvTJfR1sTR5xfSJbNGTY8GF4uDE+aBVWBBeXUA@mail.gmail.com>

On Fri, Jun 08, 2012 at 11:34:04AM +0100, Reuben Thomas wrote:
> I notice that the musl FAQ says "the fundamentally broken freadahead
> function in gnulib cannot be fixed by adding features to the C
> library". I found this question because a user complained about my use
> of gnulib in a package I maintain.
> 
> I contacted the gnulib maintainers, one of whom replied:
> 
> "IIRC, gnulib's freadahead use is caused by musl's printf not being
> posix compliant, causing gnulib to pull in its printf replacement,
> which doesn't work on musl."

The first failing test I found was invalid. It's a test for whether
printf supports printing non-finite long double values. gnulib is
constructing an illegal long double representation (which they call
"pseudo-denormal") that will never occur as a value and passing it to
printf:

|   { /* Pseudo-Denormal.  */
|     static union { unsigned int word[4]; long double value; } x =
|       { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
|     if (sprintf (buf, "%Lf", x.value) < 0
|         || !strisnan (buf, 0, strlen (buf)))
|       result |= 64;

This test should simply be removed; there is no reason printf should
handle invalid bit patterns that cannot occur as values.

The second failing test actually caught a slight bug in %ls with
precision modifiers. I've fixed it in musl git.

Still working on finding whether this long double issue is what's
causign the gnulib junk to get pulled in...

Rich


  parent reply	other threads:[~2012-06-08 14:44 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 10:34 Reuben Thomas
2012-06-08 12:19 ` Luca Barbato
2012-06-08 12:32   ` Reuben Thomas
2012-06-08 14:04 ` Szabolcs Nagy
2012-06-08 14:16   ` Rich Felker
2012-06-08 14:44 ` Rich Felker [this message]
2012-06-08 14:55   ` Rich Felker
2012-06-08 15:06     ` Szabolcs Nagy
2012-06-08 15:29       ` Rich Felker
2012-06-08 15:43         ` Reuben Thomas
2012-06-08 15:53           ` Rich Felker
2012-06-08 16:16             ` Reuben Thomas
2012-06-08 16:38               ` John Spencer
2012-06-08 16:37                 ` Reuben Thomas
2012-06-09  7:43                   ` John Spencer
2012-06-09 14:17                     ` Reuben Thomas
2012-06-08 16:46       ` John Spencer
2012-06-08 16:46         ` Reuben Thomas
2012-06-08 16:51           ` Rich Felker
2012-06-08 16:58             ` Reuben Thomas
2012-06-08 17:00           ` Rich Felker
2012-06-08 17:07             ` Reuben Thomas
2012-06-08 23:25               ` Rich Felker
2012-06-09  2:33           ` Isaac Dunham
2012-06-09  2:45             ` Rich Felker
2012-06-09 12:58               ` Szabolcs Nagy
2012-06-09 14:17                 ` Reuben Thomas
2012-06-09 21:11                 ` Rich Felker
2012-06-09 21:24                   ` Reuben Thomas
2012-06-09 14:15               ` Reuben Thomas
2012-06-11  9:37 Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120608144423.GN163@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).