From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: string-backed FILEs mess
Date: Wed, 12 Sep 2018 15:46:35 -0400 [thread overview]
Message-ID: <20180912194635.GB1878@brightrain.aerifal.cx> (raw)
In-Reply-To: <20180912193022.GD13976@voyager>
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
next prev parent reply other threads:[~2018-09-12 19:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 14:02 Rich Felker
2018-09-12 15:09 ` Markus Wichmann
2018-09-12 15:43 ` Rich Felker
2018-09-12 16:33 ` Rich Felker
2018-09-12 17:18 ` Rich Felker
2018-09-14 15:52 ` Rich Felker
2018-09-14 16:24 ` Rich Felker
2018-09-14 20:39 ` Rich Felker
2018-09-12 17:41 ` Markus Wichmann
2018-09-12 18:03 ` Rich Felker
2018-09-12 18:48 ` A. Wilcox
2018-09-12 19:30 ` Markus Wichmann
2018-09-12 19:46 ` Rich Felker [this message]
2018-09-12 15:55 ` A. Wilcox
2018-09-12 16:35 ` Rich Felker
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=20180912194635.GB1878@brightrain.aerifal.cx \
--to=dalias@libc.org \
--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).