www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23232] New: Static array limits are incorrect for -m64


          Issue ID: 23232
           Summary: Static array limits are incorrect for -m64
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: contact lsferreira.net

Even for -m32, the static array size is limited to int.max instead of uint.max.
This is a compiler backend specific issue, described here:

The target static array size limit should be a configurable global in order to
other compiler backends accommodate their limits.

For -m64, the static array size remains the same of -m32.

Example code:

struct S {
    ubyte[(int.max / 2) - 1] value;

struct S {
    ubyte[(long.max / 2) - 1] value; // doesn't compile

Jul 08 2022