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

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?

Sincerely,
Karl Palsson

  reply	other threads:[~2016-03-08 11:43 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 [this message]
2016-03-08 17:24     ` dalias

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=1457437382.3898.43.camel@etactica.com \
    --to=karlp@etactica.com \
    --cc=dalias@libc.org \
    --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).