From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1020 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: printf POSIX compliance Date: Fri, 8 Jun 2012 12:51:34 -0400 Message-ID: <20120608165134.GT163@brightrain.aerifal.cx> References: <20120608144423.GN163@brightrain.aerifal.cx> <20120608145519.GP163@brightrain.aerifal.cx> <20120608150618.GB17860@port70.net> <4FD22C6C.5040704@barfooze.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1339174577 12496 80.91.229.3 (8 Jun 2012 16:56:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2012 16:56:17 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1021-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 08 18:56:15 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Sd2Tq-0007ak-Jw for gllmg-musl@plane.gmane.org; Fri, 08 Jun 2012 18:56:10 +0200 Original-Received: (qmail 21635 invoked by uid 550); 8 Jun 2012 16:56:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21625 invoked from network); 8 Jun 2012 16:56:10 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1020 Archived-At: On Fri, Jun 08, 2012 at 05:46:10PM +0100, Reuben Thomas wrote: > On 8 June 2012 17:46, John Spencer 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