summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafayette.edu>2002-04-08 09:20:39 -0400
committerAbhijit Menon-Sen <ams@wiw.org>2002-04-08 17:00:37 +0000
commit78210658cae7b303c01be2599b05071639c1f618 (patch)
tree5a2f78995883b68add6964e62863aa50913cd7ab /pp_sort.c
parentc532c9d188d34825735bd84db34c29ace8f8f6b2 (diff)
downloadperl-78210658cae7b303c01be2599b05071639c1f618.tar.gz
Re: lib/sort.t failure -- real PATCH enclosed
Message-Id: <Pine.SOL.4.10.10204081317040.20618-100000@maxwell.phys.lafayette.edu> p4raw-id: //depot/perl@15811
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/pp_sort.c b/pp_sort.c
index aca65d3ef3..af4d7f53d2 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1376,6 +1376,8 @@ Sort an array. Here is an example:
sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale);
+See lib/sort.pm for details about controlling the sorting algorithm.
+
=cut
*/
@@ -1387,15 +1389,18 @@ Perl_sortsv(pTHX_ SV **array, size_t nmemb, SVCOMPARE_t cmp)
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);