cppcheck Wiki
Static source code analysis tool for C and C++ code
Brought to you by:
danielmarjamaki
Using char variables is not always safe.
char s8 = 0xff; char ch1 = str[s8]; // str[s8] = str[0xffffffff] int result1 = 1 | s8; // 1 | s8 => 1 | 0xffffffff
cppcheck detects these problems.
There will be false positives if either:
- It's the intended behaviour
- You know the variable will never have dangerous values
Because of the false positives, this check is in the "--all" checks.