Sujet : Re: Baby X is bor nagain
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 24. Jun 2024, 01:33:58
Autres entêtes
Organisation : None to speak of
Message-ID : <87msnbtes9.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
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?
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */