[Issue 18788] static arrays with a length specified at runtime should dynamically allocate on the stack

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 21 12:34:04 UTC 2018


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

--- Comment #2 from Mike Franklin <slavo5150 at yahoo.com> ---
Yes it is unsafe, but not any less safe than

void unsafeRecursion(size_t iterations)
{
    if(iterations)
    {
        byte[256] buffer;
        unsafeRecursion(--iterations);
    }
}

As a compromise it could be restricted to @system code.

--


More information about the Digitalmars-d-bugs mailing list