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 12:51:34 -0400	[thread overview]
Message-ID: <20120608165134.GT163@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAOnWdoivcwhGoEELHZN5Pasj0eZC+bzFJ2DBfT5cuUHXT0ZCDg@mail.gmail.com>

On Fri, Jun 08, 2012 at 05:46:10PM +0100, Reuben Thomas wrote:
> On 8 June 2012 17:46, John Spencer <maillist-musl@barfooze.de> wrote:
> >
> > this is bogus, according to Rich:
> > "all files are closed when a process terminates normally/calls exit.
> >  if you want to report write failures, just fflush(stdout) before exit and
> > check the return value"
> 
> Jim Meyering has an analysis of the problem here:
> 
> http://www.gnu.org/ghm/2011/paris/#sec-2-1

Thanks; I'll take a look.

> > gnulib is simply a huge pile of junk...
> 
> Like the stdout problem, it's not that simple! gnulib has many
> enthusiastic users, myself included, because it solves many
> portability problems and adds much useful functionality. Thanks to
> gnulib I was able to remove a total of about 1,000 lines of code from
> GNU Zile. I have not heard a single complaint from users, so I guess
> no-one tried to build it with musl. However, I have had success
> stories from users building on far-out platforms like DOS, and I've
> had far fewer bug reports on platforms I don't use since I started
> using gnulib.

I agree gnulib is very useful and successful for porting to obscure
and broken platforms by making them outwardly resemble a POSIX-like
platform. What I object to is the methodology of how replacements are
selected and the pervasive use of undefined behavior and poking at
implementation internals.

To clarify, if there's a block of ugly not-possibly-portable code
that's conditioned to only ever be compiled on known broken systems X,
Y, and Z, it's unfortunate but probably non-problematic. But if this
code is enabled on a possibly-infinite set of systems based on tests
for certain behaviors, you end up invoking undefined behavior on
systems for which you have not researched the results of that
undefined behavior, and the result could range from just not building
to serious security compromises.

> So, please file bug reports rather than insults!

I agree with this sentiment. That's why the quotation cited above was
not filed; it was dug up from a past discussion of frustration with
these kind of issues...

> gnulib has receptive
> and active maintainers, and we'll all benefit much more from fixed
> software than from merely venting frustration.

Agreed.

> As regards the particular problem with freadahead, looking at the code
> suggests a workaround of -DSLOW_BUT_NO_HACKS to avoid trying to build
> the FILE-fiddling code.

Someone building the package should not have to do this. The whole
purpose of configure is to detect the needs of the system you're
building for and get the build config right for you. The #error cases
should be removed and replaced with code that works on ANY system,
unless the relevant code will never be compiled at all except on a
known finite set of old broken systems.

Rich


  reply	other threads:[~2012-06-08 16:51 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
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 [this message]
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=20120608165134.GT163@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).