CERT Coordination Center
Unused Code Detection and Prevention Strategies
Pages
22
Time to read
27 mins
Publication
Language
English
Pages
22
Time to read
27 mins
Publication
Language
English
This technical report addresses the issue of dead, unused, or unreachable code in programming languages such as C/C++. It outlines the safety, reliability, and assurance concerns associated with such code, which can hide logic defects and expand security vulnerabilities. The report provides real-world examples of failures caused by dead code, emphasizing the importance of detecting and preventing these issues through established standards and analysis. It discusses how various programming languages, including Java, Rust, and Python, implement mechanisms to detect or prevent unreachable code at compile time. The report also examines the confusion surrounding the definitions of dead code, unused code, and unreachable code as presented by different standards bodies, highlighting the need for clarity in terminology. The conclusion summarizes the significance of addressing dead code to enhance software reliability and reduce maintenance costs.