A conditional expression leaves out its middle operand, a ?: b, an extension of GNU C
What it finds
name ?: "none" is a GNU extension meaning name ? name : "none" with name evaluated once; other compilers reject it.
From the rule's source, conditional_without_middle.rs.
const char *label(const char *name){ return name ?: "none";tx0 reports: ?: without a middle operand 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:conditional-without-middle" = "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:conditional-without-middle] reason="..."tx0 explain tx0/c:conditional-without-middle shows the same in the terminal. Found a false positive? Report it.