CWARN.CONSTCOND.WHILECondition of while expression is constantThe CWARN.CONSTCOND.WHILE checker finds instances in which the condition of a while 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() { 2 int x = 3; 3 while (x = 3) 4 { 5 x++; 6 } 7 } Klocwork flags line 3, in which the while condition is constant. |