A name that starts with two underscores or an underscore and a capital letter is declared
What it finds
#define __MY_HEADER_H or int _Count;: identifiers that start with two underscores, or with an underscore and a capital letter, are reserved for the compiler and the C library everywhere, so a program that declares one may clash with them, now or in a later version.
Macros and declarations at the top level of a file count, and functions defined there.
From the rule's source, reserved_identifier.rs.
#define __MY_HEADER_Htx0 reports: __MY_HEADER_H is a name reservedint _Count;tx0 reports: _Count is a name reservedint _lower;static int helper(void){ int __local = 1; return __local;} Turn it on, off or suppress it
The rule runs from the all tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/c:reserved-identifier" = "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:reserved-identifier] reason="..."tx0 explain tx0/c:reserved-identifier shows the same in the terminal. Found a false positive? Report it.