...
This recommendation is related to MSC12-C. Detect and remove code that has no effect or is never executed.
Noncompliant Code Example
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
CodeSonar |
| LANG.STRUCT.UC | Unreachable {Call, Computation, Conditional, Control Flow, Data Flow} | ||||||
| DEADCODE
| Can detect the specific instance where code can never be reached because of a logical contradiction or a dead "default" in Can detect the instances where code block is unreachable because of the syntactic structure of the code | |||||||
|
| Can detect violations of this recommendation when the | |||||||
| LV_UNUSED.GEN VA_UNUSED.* UNREACH.* |
| |||||||
| 1 J | Fully implemented | |||||||
PRQA QA-C |
| 1501,1503,2008,2880,2881,2882,2883,2877,3196, 3202,3203,3205,3206,3207,3210,3219,3229,3404, 3422,3423,3425,3470,2980,2981,2982,2983,2984,2985,2986 | Fully implemented | ||||||
SonarQube Plugin SonarQube |
| S1763, S1751 | |||||||
|
| Can detect violations of this recommendation when the |
...
Related Guidelines
CERT C++ Secure Coding Standard | MSC07-CPP. Detect and remove dead code |
ISO/IEC TR 24772 | Unspecified functionality [BVQ] Dead and deactivated code [XYQ] |
MISRA C:2012 | Rule 2.1 (required) |
MITRE CWE | CWE-561, Dead code |
...