mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "dalias@libc.org" <dalias@libc.org>
To: "Karl Pálsson" <karlp@etactica.com>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>,
	"karlp@tweak.net.au" <karlp@tweak.net.au>
Subject: Re: [PATCH] search: call user compare with "correct" order params
Date: Tue, 8 Mar 2016 12:24:05 -0500	[thread overview]
Message-ID: <20160308172405.GD9349@brightrain.aerifal.cx> (raw)
In-Reply-To: <1457437382.3898.43.camel@etactica.com>

On Tue, Mar 08, 2016 at 11:43:03AM +0000, Karl Pálsson wrote:
> On Wed, 2016-02-24 at 12:41 -0500, Rich Felker wrote:
> 
> > I've read some of the scrollback from the discussion of this on IRC,
> > and I think:
> > 
> > 1. Regardless of whether the patch is accepted or not, applications
> >    using this interface in non-portable ways should be fixed.
> > 
> > 2. As you said, lfind/lsearch are useless functions. Aside from the
> >    order of the arguments being unspecified (which doesn't hurt code
> >    using them in the intended way), they're just going to be a lot
> >    slower than inlining the comparison in your own for loop.
> > 
> > Is there existing software that's affected by this issue for which
> > it's hard to get a fix upstream?
> 
> Given that musl has two choices:
> 
> a) compliant with POSIX
> b) compliant with POSIX, uclibc, glibc, bsdlibc
> 
> I find it rather disappointing that the first response is "your
> application is wrong" rather than, "yeah, option (b) does sound better"
> 
> Given how vague the actual posix docs are on these functions, yes, it's
> a bad idea to ever use them.  However, given how vague the actual posix
> docs are, I think it's hard to say whether the way I was using lfind
> was actually not allowed.  (lsearch, sure, it has to insert)
> Regardless, I have "fixed" my application.  Maybe you could "fix" musl
> to be as equally compliant as ever before, and completely cut off
> anyone else ever having to even have this discussion again?

I'm not rejecting it; I'm just backlogged with lots of things and was
waiting for feedback from the community on this. Adding new contracts
beyond the specified contract for an interface is a big deal and
sometimes has unforseen consequences. This is probably not such a
case, but we've been bitten by it before -- adding a nonstandard
behavior only to find out later that properly supporting it imposes
costly constraints elsewhere. It wasn't my intent with the previous
reply to be hostile, just to express that the portable solution is
already better for multiple reasons (especially, performance and
simplicity in the caller).

Rich


      reply	other threads:[~2016-03-08 17:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 12:12 Karl Palsson
2016-02-24 17:41 ` Rich Felker
2016-03-08 11:43   ` Karl Pálsson
2016-03-08 17:24     ` dalias [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=20160308172405.GD9349@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=karlp@etactica.com \
    --cc=karlp@tweak.net.au \
    --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).