$status = checkequal(\@sorted, $unsorted);
is($status, '', "contents ok for size $ts");
}
- # P5P: The following test (#58) has been observed failing on
- # a solaris 2.8 platform. Failure doesn't mean that sort is
- # misbehaving, it is just exhibiting an exceedingly unlikely
- # pattern of breaking ties. If you see no other failures,
- # it should be perfectly safe to install.
+ # If the following test (#58) fails, see the comments in pp_sort.c
+ # for Perl_sortsv().
if ($expect_unstable) {
ok($unstable_num > 0, 'Instability ok');
}
sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale);
+See lib/sort.pm for details about controlling the sorting algorithm.
+
=cut
*/
SV **hintsvp;
I32 hints;
- if ((hints = SORTHINTS(hintsvp))) {
- if (hints & HINT_SORT_QUICKSORT)
- sortsvp = S_qsortsv;
- else {
- if (hints & HINT_SORT_MERGESORT)
- sortsvp = S_mergesortsv;
- else
- sortsvp = S_mergesortsv;
- }
+ /* Sun's Compiler (cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2) used
+ to miscompile this function under optimization -O. If you get test
+ errors related to picking the correct sort() function, try recompiling
+ this file without optimiziation. -- A.D. 4/2002.
+ */
+ hints = SORTHINTS(hintsvp);
+ if (hints & HINT_SORT_QUICKSORT) {
+ sortsvp = S_qsortsv;
+ }
+ else {
+ /* The default as of 5.8.0 is mergesort */
+ sortsvp = S_mergesortsv;
}
sortsvp(aTHX_ array, nmemb, cmp);