Code that is executed but does not perform any action, or that has an unintended effect, most likely results from a coding error and can cause unexpected behavior. Statements or expressions that have no effect should be identified and removed from code. Most modern compilers, in many cases, can warn about code that has no effect. (See MSC00-C. Compile cleanly at high warning levels.)
...
The presence of code that has no effect can indicate logic errors that may result in unexpected behavior and vulnerabilities.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MSC12-C | lowLow | unlikelyUnlikely | mediumMedium | P2 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
| NO_EFFECT | Finds statements or expressions that do not accomplish anything or statements that perform an unintended action | |||||||
| CC2.MSC12 | Partially implemented | |||||||
3.0 | Options detect unused local variables or nonconstant static variables and unused function parameters, respectively | ||||||||
| EFFECT |
| |||||||
| 65 D | Fully implemented | |||||||
PRQA QA-C |
| 3110 | Partially implemented | ||||||
|
|
|
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...