CodeQL queries 1.24
This rule finds uses of the assignment operator
= in places where the
== would make more sense. This is a very common mistake in
C and C++, because of the similarity of the
= and the
and the fact that the
if statement accepts
a condition with an integral type, instead of limiting it to just the
The rule flags every occurrence of an assignment in a position where its result is interpreted as a truth value. An assignment is only flagged if its right hand side is a compile-time constant.
Check to ensure that the flagged expressions are not typos. If an assignment is really intended to be treated as a truth value, it may be better to surround it with parentheses.