A block is used as an expression, ({ ... }), an extension of GNU C
What it finds
int y = ({ int t = f(); t * t; }); is a GNU extension that other compilers reject.
From the rule's source, statement_expression.rs.
int square_next(int x){ return ({ int t = x + 1; t * t; });tx0 reports: a statement expression 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:statement-expression" = "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:statement-expression] reason="..."tx0 explain tx0/c:statement-expression shows the same in the terminal. Found a false positive? Report it.