3 ms·
> clang and gcc don't warn on this because real large codebases have an (unfortunate?) number of assignments inside boolean expressions Definitely. I personall
by acdha 13y ago
> clang and gcc don't warn on this because real large codebases have an (unfortunate?) number of assignments inside boolean expressions
Definitely. I personally find that style bad because it's concealed a far number of bugs in the past (either things like the =/== confusion or simply logic errors when the line became long enough that scanning it is non-trivial) but the only way that could fly for a compiler would be as a flag or pragma allowing you to opt-in for valid-but-discouraged style warnings and that's served well enough by existing linters that standardization isn't worth the cost of moving it into a compiler.