[Issue 18010] New: Undefined reference to _d_arraycopy when copying arrays in -betterC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 25 03:56:48 UTC 2017


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

          Issue ID: 18010
           Summary: Undefined reference to _d_arraycopy when copying
                    arrays in -betterC
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: slavo5150 at yahoo.com

From: http://forum.dlang.org/post/qcsgtxdiewfeiwckagqj@forum.dlang.org

---------------------------------
import core.stdc.stdio;
import std.algorithm : min;

extern (C) void main()
{
    char[256] buf;
    buf[] = '\0';

    auto str = "hello world";
    auto ln = min(buf.length, str.length);
    buf[0..ln] = str[0..ln];
    printf("%s\n", buf.ptr);
}

rdmd -betterC bettercarray2.d

/tmp/.rdmd-1000/rdmd-bettercarray2.d-435C14EC3DAF09FFABF8ED6919B624C1/objs/bettercarray2.o:
In function `main':
bettercarray2.d:(.text.main[main]+0xbc): undefined reference to `_d_arraycopy'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1

---------------------------------

If I add -noboundscheck flag all works fine.

--


More information about the Digitalmars-d-bugs mailing list