February 08 [Issue 24377] New: Error: negative array dimension `3145728u * 1024u`[32bit] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24377 Issue ID: 24377 Summary: Error: negative array dimension `3145728u * 1024u`[32bit] Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: kdevel@vogtner.de $ cat nad.d import std.stdio; void main() { auto arr = new char [3u * 1024 * 1024 * 1024]; // <--- error writefln ("%X", arr.length); } $ dmd -m32 ./nad.d ./nad.d(5): Error: negative array dimension `3145728u * 1024u` [unexpected] $ gdc -m32 nad.d -o nad $ ./nad C0000000 [expected] $ cat nad2.d import std.stdio; void main() { auto siz = 3u * 1024 * 1024 * 1024; auto arr = new char [siz]; writefln ("%X", arr.length); } $ dmd -m32 ./nad2.d $ ./nad2 C0000000 [expected] used compilers: - DMD64 D Compiler v2.105.3 - gcc (GCC) 12.1.0 -- |
Copyright © 1999-2021 by the D Language Foundation