Open zmodem opened 1 year ago
Let me work on this issue.
I guess the change for this would be to add a new warning flag within -Wparentheses
that detects comparison operators within comparison operators, just like '&&' within '||'.
I can't find the revision in phab, but does this also fix https://github.com/llvm/llvm-project/issues/31470 ?
This is the differential I made some time ago. https://reviews.llvm.org/D142800
I intend to fix that issue as well.
We had this
=
vs.==
bug in Chromium recently:In most cases, Clang would catch a
=
vs==
bug with-Wunused-comparison
, but in this case the unintentional comparison became an operand to the ternary operator, and no warning fired.Perhaps there should be warning for the general case of "chained comparisons" that would catch the above as well as code like: