Deutsch English Français Italiano |
<86tthmhnat.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch <tr.17687@z991.linuxsc.com> Newsgroups: comp.lang.c Subject: Re: Baby X is bor nagain Date: Thu, 20 Jun 2024 22:34:02 -0700 Organization: A noiseless patient Spider Lines: 20 Message-ID: <86tthmhnat.fsf@linuxsc.com> References: <v494f9$von8$1@dont-email.me> <v4emki$28d1b$1@dont-email.me> <20240613174354.00005498@yahoo.com> <v4okn9$flpo$2@dont-email.me> <20240617002924.597@kylheku.com> <v4pddb$m5th$1@dont-email.me> <20240618115650.00006e3f@yahoo.com> <v4rv0o$1b7h1$1@dont-email.me> <20240618184026.000046e1@yahoo.com> <v4sd75$1ed31$1@dont-email.me> <877celzx14.fsf@nosuchdomain.example.com> <v4u85k$1t2pu$2@dont-email.me> <v4ucmn$1u14i$1@dont-email.me> <v4v2br$22c0m$1@dont-email.me> <v4v5nu$230rh$2@dont-email.me> <v4vfrn$24rv6$1@dont-email.me> <v50n9s$2fkko$1@dont-email.me> <v50poh$2g4ha$1@dont-email.me> <87iky3svqh.fsf@bsb.me.uk> <86y16zhcy3.fsf@linuxsc.com> <v51mvd$2lhe2$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 21 Jun 2024 07:34:03 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b1207652c594f8095021b04518fba685"; logging-data="3184435"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1833Mc113zpByOUvudt7ynAj6gsJArhaGw=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:59WJ85+/Te/L+ZVmhGsE6XAk29g= sha1:bXNNt1kIOVl7+vUzIGK0hP+uhpk= Bytes: 2353 Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > On 20/06/2024 16:05, Tim Rentsch wrote: > [.. on qsort compare function ..] >> My reading of the C standard is that the comparison function >> must impose a total ordering on the elements actually present >> in the array, or is undefined behavior if it does not. In >> other words it's okay if the comparison function doesn't >> define a proper order relation, as long as there are no >> inconsistencies between values that actually occur in the >> particular array being sorted. > > Yes, a qsort written in the natural way can getstuck if a > sub0array it considered sorted becmes not sortted on the next > pass. Not get stuck. The array might not be sorted correctly, but the algorithm doesn't get stuck.