This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [COMMITED][v2] manual: Remove incorrect claim that qsort() can be stabilized
- From: Florian Weimer <fweimer at redhat dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>, OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Anders Kaseorg <andersk at MIT dot EDU>, libc-alpha at sourceware dot org
- Date: Thu, 11 Dec 2014 10:24:30 +0100
- Subject: Re: [COMMITED][v2] manual: Remove incorrect claim that qsort() can be stabilized
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1407022115210 dot 28890 at all-night-tool dot MIT dot EDU> <20141210154909 dot GA31968 at domone> <54892DF9 dot 8080007 at cs dot ucla dot edu>
On 12/11/2014 06:39 AM, Paul Eggert wrote:
OndÅej BÃlka wrote:
+The addresses passed to the comparison function need not correspond with
+the original location of the objects, and need not even lie within the
+original array.
The last clause is incorrect. C11 and POSIX both require that the
addresses passed to the comparison function must point to elements of
the original array, and glibc qsort conforms to the standards here.
Ugh, that's a new requirement in C99, isn't it?
(Although the expressions which are required to evaluate to true do not
evaluate to false if the element lies outside the array being compared
because they are simply undefined.)
--
Florian Weimer / Red Hat Product Security