Deutsch English Français Italiano |
<861q4mflox.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: Mon, 24 Jun 2024 07:40:46 -0700 Organization: A noiseless patient Spider Lines: 38 Message-ID: <861q4mflox.fsf@linuxsc.com> References: <v494f9$von8$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> <874j9nxsdy.fsf@nosuchdomain.example.com> <874j9ns382.fsf@bsb.me.uk> <86h6dlhb34.fsf@linuxsc.com> <8734p3rjno.fsf@bsb.me.uk> <v59bhe$ch8p$1@dont-email.me> <86zfrbfsd6.fsf@linuxsc.com> <87msnbtes9.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Mon, 24 Jun 2024 16:40:48 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b3b1304951eae8dc1e53ef86c96f1e35"; logging-data="1040447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5w8l4eIxHSYNPhVs4YLeLcL2pJHc+qGc=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:3jOjLcTLl4t2KO82qsGj1GtWb2E= sha1:9qCwtQgCLzD1tLQHrU12bAHPwgg= Bytes: 3210 Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: > Tim Rentsch <tr.17687@z991.linuxsc.com> writes: > >> James Kuyper <jameskuyper@alumni.caltech.edu> writes: >> [on the requirements for qsort] >> >>> I certainly would favor improved wording that made this clearer. >>> In fact, simply explicitly mandating total ordering rather than >>> making a vague comment about consistency would probably be the >>> best approach. >> >> Clearly the C standard intends to impose a weaker requirement >> than that the comparison function be a total ordering. > > "That is, for qsort they shall define a total ordering on the > array". > > I presume you didn't intend to contradict that requirement, but > I can't figure out what you meant -- unless, as Ben suggested, > you're distinguishing between a total ordering of all possible > arguments and a total ordering of objects present in the array. > But even then, the standard explicitly imposes a total ordering. > (The requirements for bsearch might be weaker, but we're discussing > qsort.) > > Can you clarify what you meant? For starters, saying that the comparison function defines a total ordering of elements actually present in the array is already a weaker requirement than saying that the comparison function defines a total ordering of all values that might legally be present in the array. Now notice that the C standard isn't referring to the comparison function in the statement quoted above. The standard does not say "the comparison function shall define". What it does say is that "/they/ shall define". Those two aren't the same thing.