default initialization of char arrays

Vindex9 tech.vindex at gmail.com
Thu Oct 2 07:33:14 UTC 2025


On Monday, 8 September 2025 at 15:44:27 UTC, Walter Bright wrote:
> https://dlang.org/spec/arrays.html#static-init-static

I've been programming in D for many years because of such 
wonderful language features. But, in my opinion, we need to focus 
on stabilizing and fixing what we already have. Speaking of 
static arrays, I’d like to remind that we've had a long-standing 
bug with a segmentation fault: type inference doesn't work for a 
static array of type `real[1]`.

```
void main() {
     import std.stdio : writeln;
     real[1] arr = 0;
     writeln(arr); // SEGFAULT
}
```
https://github.com/dlang/dmd/issues/21323


More information about the Digitalmars-d mailing list