...
Automated Detection
The LDRA tool suite V Version 7.6.0 can detect violations of this recommendation.
GCC Compiler Version can detect some violations of this recommendation when the -Wswitch
and -Wswitch-default
flags are used.
...
Code Block | ||
---|---|---|
| ||
if (x > 0) { /* ... */ } else if (x < 0) { /* ... */ } else if (x == 0) { /* ... */ } |
The Klocwork LA_UNUSED checker Klocwork Version 8.0.4.16 can detect violations of this rule with the LA_UNUSED checker.
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...