On Tue, Dec 24, 2024 at 12:36 AM Florian Weimer <fwei...@redhat.com> wrote:
> > On Mon, Dec 23, 2024 at 8:47 PM Florian Weimer <fwei...@redhat.com> wrote:
> >> It's a bit odd that you disable reflexivity checks by default, but quite
> >> a few of the issues reported are in this category.
> >
> > I think back then I wanted to make default settings free of false
> > positives. Often sorted arrays may only contain unique elements and in
> > such cases reflexivity checks are useless.
>
> Are they?  In the longstanding glibc quicksort implementation (usually
> hidden behind a merge sort), reflexivity was required to rediscover an
> element that the implementation assumed to be there and dependent upon
> for loop termination.

Interesting. I remember being told in GCC mailing list (or was it
IRC?) that qsort implementations typically will not compare element to
itself.

See also https://gcc.gnu.org/pipermail/gcc/2018-January/225098.html

-Y

Reply via email to