A bit-field of one bit has a signed type, so it holds 0 and -1 rather than 0 and 1

tx0/cpp:signed-one-bit-fieldrecommendedwarningreliability/arithmeticdepth fastbug

What it finds

int ready : 1;: a one-bit field of a signed type can hold only 0 and -1, so setting it to 1 and testing ready == 1 fails; and whether plain int is signed in a bit-field depends on the compiler. unsigned int or bool holds 0 and 1.

From the rule's source, signed_one_bit_field.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:signed-one-bit-field" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:signed-one-bit-field] reason="..."

tx0 explain tx0/cpp:signed-one-bit-field shows the same in the terminal. Found a false positive? Report it.