E1070: pack storage is not unsigned fixed storage

View source

A pack has a backing store whose size is fixed before the program runs.

A pack has a backing store whose size is fixed before the program runs. The store is an unsigned integer of 8, 16, 32, 64 or 128 bits, or an Array[u8, N] with a positive N of at most 8191 bytes. A signed integer, an odd width such as u12, another array element type or a zero-length array cannot back a layout whose bit positions are part of its type. The message names the pack and the storage type. The error points at the storage type.

Example

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

verb main() {
}

Fix

Use an unsigned storage type of a supported width, and size the fields to fill it.

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 E1070 in your terminal to read this entry offline. Browse Ownership & types or all error codes.