E1074: pack leaves bits uncovered

View source

The fields of a pack must account for every bit of the store (ADR-0026).

The fields of a pack must account for every bit of the store (ADR-0026). A gap would be padding that nobody named, and its value would be left to chance. Unused bits are written as an explicit field called _reserved, which may give them a default value. The message gives the first and the end of the uncovered range. The error points at the pack.

Example

actus
pack Flags {
    erg storage: u8;
    layout little;
    fields {
        erg enabled: u1 at 0;
    }
}

verb main() {
}

Fix

Add a _reserved field that covers the gap.

actus
pack Flags {
    erg storage: u8;
    layout little;
    fields {
        erg enabled: u1 at 0;
        abs _reserved: u7 at 1 = 0;
    }
}

verb main() {
}

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