CWARN.BOOLOP.INCAttempt to increment a Boolean valueThe CWARN.BOOLOP.INC checker finds attempts to increment or decrement a Boolean value. Vulnerability and riskUsing increment or decrement operations with a Boolean true/false value has no effect. Vulnerable code example1 #include <iostream> 2 using namespace std; 3 void foo() { 4 bool b = true; 5 b++; 6 } 7 int main() { 8 foo(); 9 return 0; 10 } Klocwork flags the attempt to increment Boolean variable 'b' at line 5. |