A function is defined in the old style, with the types of its parameters declared after the parentheses
What it finds
int add(a, b) int a, b; { ... }: definitions of this kind do not give the function a prototype, so calls are not checked against the parameters, and C23 removed them.
From the rule's source, old_style_definition.rs.
int add(a, b)tx0 reports: add is defined in the old style without a prototype int a, b;{ return a + b;} int sub(int a, int b){ return a - b;} 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:old-style-definition" = "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:old-style-definition] reason="..."tx0 explain tx0/c:old-style-definition shows the same in the terminal. Found a false positive? Report it.