[Issue 17188] New: `core.stdc.stdlib.qsort()` is broken

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 15 21:03:31 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17188

          Issue ID: 17188
           Summary: `core.stdc.stdlib.qsort()` is broken
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: ketmar at ketmar.no-ip.org

the following code doesn't compile anymore (git HEAD):


import core.stdc.stdlib;

extern(C) int cmp (const void *a, const void *b) { return 0; }

void main () {
  int[4] arr;
  qsort(arr.ptr, arr[0].sizeof, arr.length, &cmp);
}


...due to added `scope` in compare function prototype. i think we should not
break user's code right away, there should be a deprecation stage first.

--


More information about the Digitalmars-d-bugs mailing list