[Issue 24613] New: Bitfield with 64 bits always zero

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 16 17:10:00 UTC 2024


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

          Issue ID: 24613
           Summary: Bitfield with 64 bits always zero
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: tim.dlang at t-online.de

Values for a bitfield with 64 bits are not stored and remain 0.
```
struct S
{
    ulong a:64;
}

void main()
{
    S s;
    s.a = 1;
    assert(s.a == 1); // Fails: s.a is 0
}
```

This affects both ImportC and normal D with -preview=bitfields.

--


More information about the Digitalmars-d-bugs mailing list