The size of one array is divided by the size of an element of another array

tx0/cpp:sizeof-division-mismatchstrictwarningreliability/memory-safetydepth fastbug

What it finds

sizeof(names) / sizeof(ids[0]): the number of elements of one array is computed with the element size of another, which is right only while both have elements of the same size. Usually one name was copied from a line about the other array.

Both operands of / must be sizeof of names declared as arrays in the file, the right one taking an element with [0] or *.

From the rule's source, sizeof_division_mismatch.rs.

Turn it on, off or suppress it

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

tx0.toml
[rules]
"tx0/cpp:sizeof-division-mismatch" = "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:sizeof-division-mismatch] reason="..."

tx0 explain tx0/cpp:sizeof-division-mismatch shows the same in the terminal. Found a false positive? Report it.