There shall be no dead code
There shall be no dead code.
If an operation is reachable but removing the operation does not affect program behavior, the operation constitutes dead code.
The presence of dead code can indicate an error in the program logic. Because a compiler can remove dead code, its presence can cause confusion for code reviewers.
Operations involving language extensions such as __asm
( "NOP" ); are not considered dead code.
Polyspace® Bug Finder™ detects useless write operations during analysis.
Polyspace Code Prover™ does not detect useless write operations. For instance, if you assign a value to a local variable but do not read it later, Polyspace Code Prover does not detect this useless assignment. Use Polyspace Bug Finder to detect such useless write operations.
In Code Prover, you can also see a difference in results based on your choice for the option . See Check for Coding Standard Violations.
If you expect a rule violation but do not see it, refer to Coding Standard Violations Not Displayed.
| Group: Unused Code |
| Category: Required |
| AGC Category: Required |