From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13238 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: string-backed FILEs mess Date: Wed, 12 Sep 2018 15:46:35 -0400 Message-ID: <20180912194635.GB1878@brightrain.aerifal.cx> References: <20180912140239.GV1878@brightrain.aerifal.cx> <20180912150941.GB13976@voyager> <20180912154306.GW1878@brightrain.aerifal.cx> <20180912174112.GC13976@voyager> <20180912193022.GD13976@voyager> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1536781483 3917 195.159.176.226 (12 Sep 2018 19:44:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2018 19:44:43 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13254-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 12 21:44:38 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1g0B42-0000t4-KO for gllmg-musl@m.gmane.org; Wed, 12 Sep 2018 21:44:38 +0200 Original-Received: (qmail 30460 invoked by uid 550); 12 Sep 2018 19:46:47 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30442 invoked from network); 12 Sep 2018 19:46:47 -0000 Content-Disposition: inline In-Reply-To: <20180912193022.GD13976@voyager> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13238 Archived-At: On Wed, Sep 12, 2018 at 09:30:22PM +0200, Markus Wichmann wrote: > On Wed, Sep 12, 2018 at 01:48:37PM -0500, A. Wilcox wrote: > > Happy early Hallowe'en: > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87096 > > > > You know, if I were programming on Linux professionally rather than as a > hobby, stuff like this would drive me to drink. I mean, in this case it > is a return value on a pathological case, but actually, it's sort of my > point: C says, snprintf() is undefined with a buffer size of more than > INT_MAX, POSIX defines it, and GCC just goes with the ISO-C version -- > because they can? Great! In this case, it's not undefined. ISO C defines it as success (there's nothing erroneous about the buffer being large; it's only an error if the output would exceed INT_MAX in length). POSIX then erroneously (because it nominally extends C and defers to it in case of accidental conflict) redefines it as an error. Rich