builtin sort

Stephan Schiffels stephan_schiffels at mac.com
Sat Jun 8 01:30:52 PDT 2013


Hi,

I know it has been discussed previously to deprecate the builtin 
sort. I don't know the status of this, but I observed the 
following problem.

With dmd, druntime and phobos all on 2.063, this program runs 
successfully on a mac:

#!/usr/bin/env rdmd

import std.stdio;

void main() {

   int[] a = [5, 4, 3, 2, 1];

   a.sort;
   writeln(a);

}

But it fails on linux, with the line:


/nfs/users/nfs_s/ss27/Software/dlang/phobos/generated/linux/release/64/libphobos2.a(qsort_4c4_2cc.o): 
In function `_adSort':
src/rt/qsort.d:(.text._adSort+0x47): undefined reference to 
`qsort_r'
collect2: ld returned 1 exit status
--- errorlevel 1


When I change "a.sort" -> "a.sort()" and add import std.algorithm 
everything works fine.
Does this mean that the builtin sort on Linux is broken with 
2.063?

Stephan


More information about the Digitalmars-d mailing list