This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [COMMITED][v2] manual: Remove incorrect claim that qsort() can be stabilized


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]