A conditional expression leaves out its middle operand, a ?: b, an extension of GNU C

tx0/c:conditional-without-middlestrictwarningstyle/conventionsdepth faststyle

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.

Example from the rule's tests
const char *label(const char *name){  return name ?: "none";tx0 reports: ?: without a middle operand is an extension of GNU C}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

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:

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.