Arithmetic is done on a void *, an extension of GNU C
What it finds
void *p; p + 4: standard C has no arithmetic on void *, since void has no size; GNU C counts in bytes. Converting to char * or unsigned char * is portable.
From the rule's source, void_pointer_arithmetic.rs.
void *skip_header(void *data){ return data + 16;tx0 reports: this arithmetic on a void * is an extension of GNU C} 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:
[rules]
"tx0/c:void-pointer-arithmetic" = "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/c:void-pointer-arithmetic] reason="..."tx0 explain tx0/c:void-pointer-arithmetic shows the same in the terminal. Found a false positive? Report it.