CWARN.CONSTCOND.IFCondition of if expression is constantThe CWARN.CONSTCOND.IF checker finds instances in which the condition of a if statement is constant. Vulnerability and riskA constant condition for a statement typically results in the program's intention not being accomplished, with probable unexpected consequences. Vulnerable code example1 void foo(int x) { 2 if (x=10) {} 3 } Klocwork flags line 2, which contains a condition that will never change. |