E1073: pack fields overlap

View source

Two fields of a pack may not share a bit (ADR-0026).

Two fields of a pack may not share a bit (ADR-0026). Every bit then belongs to one field, and a write to one field cannot change another. The message names both fields and the bits they share, written as a half-open range. The error points at the later field.

Example

actus
pack Flags {
    erg storage: u8;
    layout little;
    fields {
        erg mode: u4 at 0;
        erg enabled: u1 at 2;
        abs _reserved: u3 at 5 = 0;
    }
}

verb main() {
}

Fix

Move one field so that the ranges are disjoint.

actus
pack Flags {
    erg storage: u8;
    layout little;
    fields {
        erg mode: u4 at 0;
        erg enabled: u1 at 4;
        abs _reserved: u3 at 5 = 0;
    }
}

verb main() {
}

Run actus explain E1073 in your terminal to read this entry offline. Browse Ownership & types or all error codes.