A plain char is passed to a function of ctype.h, which is undefined for negative values
What it finds
isspace(*p) with char *p: the functions of ctype.h take an int that must be an unsigned char value or EOF. Where char is signed, bytes above 127 are negative and index outside the library's tables; isspace((unsigned char)*p) is defined.
The argument must have the type plain char as the file declares it.
From the rule's source, ctype_plain_char.rs.
#include <ctype.h> int words(const char *p, unsigned char u){ int n = 0; if (isspace(*p))tx0 reports: *p is a char, which may be negative when given to isspace n++; if (isspace((unsigned char)*p)) n++; return n + isdigit(u);} 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:ctype-plain-char" = "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:ctype-plain-char] reason="..."tx0 explain tx0/c:ctype-plain-char shows the same in the terminal. Found a false positive? Report it.