Automatically Catching Undefined Behavior
Introduction This article summarizes my experince while using four different tools that detect undefined behavior in C/C++ programs, including some metrics, examples and which programs are best for what cases. The programs that will be mentioned throughout this article are: Undefined Behavior Sanitizer (UBSAN) - From Clang; Valgrind - From Valgrind; Frama-C’s EVA plugin - From Frama-C; KCC - From Runtime Verification; What is Undefined Behavior? Undefined behavior (UB) in C and C++ refers to code whose behavior is unpredictable according to the language specification....