digitalmars.D.bugs - [Issue 14859] New: static declared array with more than 16MB size
- via Digitalmars-d-bugs (39/39) Aug 01 2015 https://issues.dlang.org/show_bug.cgi?id=14859
https://issues.dlang.org/show_bug.cgi?id=14859 Issue ID: 14859 Summary: static declared array with more than 16MB size should be allowed in struct and class declaration Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: nightmarex1337 hotmail.com import std.stdio; struct Stuff { double someData, otherData; wchar[120] someFilePath; // byte[1024*1024*16] hugeArray; // Error: index 16777216 overflow for static array byte[1024*1024*8] hugeArrayPart_1; // dirty hack byte[1024*1024*8] hugeArrayPart_2; SomeOtherComplexStruct theComplexStruct; } int main(string[] argv) { Stuff* st = new Stuff(); writeln((*st).sizeof); readln(); return 0; } 16MB or more sized types should be allowed in order to make above code work without using dirty hacks "global static sized arrays" and "static sized arrays inside static class/struct" more than 16MB size should still not compile (or maybe a warning is better?) they just blow up output size and also heard optlink cause problems but don't know if it's relevant to above code. --
Aug 01 2015