mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: "Matthias Görgens" <matthias.goergens@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [BUG] hasmntopt weirdness
Date: Thu, 30 Mar 2023 11:40:38 -0400	[thread overview]
Message-ID: <20230330154038.GD4163@brightrain.aerifal.cx> (raw)
In-Reply-To: <CA+X7ob9ss-B9MUjDxp83QZ4+8VrK-GJaDK50UygoWK32TrPrLQ@mail.gmail.com>

On Thu, Mar 30, 2023 at 10:47:27PM +0800, Matthias Görgens wrote:
> On Thu, 30 Mar 2023 at 21:57, Rich Felker <dalias@libc.org> wrote:
> > I'm pretty sure it was agreed upon at one point that this was a bug,
> > but never pursued further.
> 
> OK, that's good to know!
> 
> > From what I remember, I think hasmntopt needs to check that the match
> > found is at the start or immediately follows a comma (unless there is
> > some awful way to embed literal commas) and that it's followed by an
> > equals sign, comma, or nul terminator. Does this sound correct?
> 
> For what it's worth, that's close to what glibc does.
> 
> Sorry, I'm new to this: Is there a spec to these things, or do we just copy what
> the other C standard libraries are doing?

For standard functions, there is a spec.

For nonstandard ones, generally no, and that's why musl frowns on
them. We have to basically do what the standardization process would
have done: looking at historical practice and whether the interface
and behavior was sufficiently consistent across different historical
systems with the nonstandard extension that we can work out a behavior
that's not conflicting with what applications might expect.

When this is difficult or impossible, that's a strong indication that
we shouldn't adopt the interface at all. But due to historical
mistakes (not doing sufficient analysis to apply these principles), we
let a few things in we shouldn't have.


      reply	other threads:[~2023-03-30 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 10:02 Matthias Görgens
2023-03-30 13:57 ` Rich Felker
2023-03-30 14:47   ` Matthias Görgens
2023-03-30 15:40     ` Rich Felker [this message]

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=20230330154038.GD4163@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=matthias.goergens@gmail.com \
    --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).