This is the mail archive of the
mailing list for the glibc project.
Re: qsort_r argument order
- From: Eus <eus at member dot fsf dot org>
- To: libc-alpha at sourceware dot org, Dustin Lang <dstn at cs dot toronto dot edu>
- Date: Tue, 2 Dec 2008 18:00:44 -0800 (PST)
- Subject: Re: qsort_r argument order
- Reply-to: eus at member dot fsf dot org
--- On Wed, 12/3/08, Dustin Lang <firstname.lastname@example.org> wrote:
> I suppose this comment is coming too late, but I really
> wish that the qsort_r function had been done differently.
> As far as I can tell, qsort_r is not part of any standard,
> but it exists in BSD (including Mac OSX). For some reason
> that I can't comprehend, when it was added to glibc the
> argument order was permuted.
> extern void qsort_r (void *__base, size_t __nmemb, size_t
> __compar_d_fn_t __compar, void *__arg)
> __nonnull ((1, 4));
> void qsort_r(void *base, size_t nel, size_t width, void
> int (*compar)(void *, const void *, const void
Exactly as you have said before, it is because qsort_r is not part of any standard.
So, the same argument can be made for BSD and Mac OSX: why they permute the parameters?
I am sure you will ask the same questions in their mailing lists if you develop your software primarily for GNU/Linux systems.
Eus (FSF member #4445)
In this digital era, where computing technology is pervasive,
your freedom depends on the software controlling those computing devices.
Join free software movement today!
It is free as in freedom, not as in free beer!