E1126: realtime code has an unbounded loop

View source

A loop runs until a break, so the compiler cannot say how long it takes.

A loop runs until a break, so the compiler cannot say how long it takes. A verb marked meta realtime therefore may not contain one (ADR-0094). Loops over a range or over a fixed array are accepted, because their length is known when the program is compiled.

Example

actus
meta realtime
verb spin() {
    loop {
    }
}

verb main() {
}

Fix

Use a range loop with fixed ends.

actus
meta realtime
verb spin() {
    for erg index: u32 in 0u32..8u32 {
    }
}

verb main() {
}

Run actus explain E1126 in your terminal to read this entry offline. Browse Modules & rules or all error codes.