The Most Popular Bugs and Code Smells in C and C++
summary
Sonar data yields a ranked list of the most common static-detectable bugs in C/C++ (ranking = reach + bug count ÷ 2), led by uninitialized variables, buffer overflows, null dereferences, leaks, identical-expr bugs, missing returns, destructors throwing and single-iteration loops. Detection uses clang AST matchers and symbolic execution; mitigation includes modern C++ (std::string/vector/unique_ptr), compiler warnings, and sanitizers — e.g. AddressSanitizer and ThreadSanitizer — which the presenter shows finding real-world issues and a Sonar-derived top-10 (slides and survey linked in uploader description).
AI-written summary · about
chapters (24)
- 0:00Notorious bugs in C/C++
- 1:49Static analysis tools
- 14:56Top 10 bugs ranked
- 18:09Uninitialized variables
- 22:26Buffer overflows alternatives
- 25:59Null pointer dereferences
- 28:26Unreachable code flaws
- 29:54Resource leaks RAII
- 31:41Identical binary expressions
- 32:47Missing return values
- 34:36Identical branches errors
- 35:18Destructors never throw
- 37:25Single-iteration loops
- 38:07Real-world bug examples
- 43:08Modern C++ mitigation
- 45:17Static analysis limits
- 47:45Intent with annotations
- 48:27Reference lifetime issues
- 50:16Iterator invalidation
- 52:47Race conditions safety
- 54:34Dynamic analysis sanitizers
- 56:18C++ education improvement
- 57:20Compiler analyzer best practices
- 57:43Q&A
related talks
52mNobody Can Program Correctly - Lessons From 20 Years of Debugging C++ Code
36mCode Analysis: Empowering developers to write performant, reliable, and safe C++
26mUndefined Behavior in 2017 (part 2 of 2)
59mHardening Your Code
01h 01mBack to Basics: Debugging in Cpp
05mDetecting Programs That Rely on Undefined Behavior
09mModern Static Code Analysis the Example of PVS-Studio
55mSquash Bugs with Static Analysis
