A Path to Practically Safe C++
summary
Google proposes a compiler-enforced spatial safety mode that bounds-checks static arrays, bans unchecked pointer arithmetic, and pushes spanification; Clang warnings and thousands of automated PRs already spanify code and a unique_array wrapper replaces unique_ptr<T[]> for sized allocations. A new lifetime safety analysis (Clang/clang-tidy) uses Polonius-style points-to and invalidation summaries, finds real bugs, and helps infer annotations; one project reports ~35% fewer null-dereference crashes, protobuf bounds checking costs ~0.3% on average.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 3:35Memory safety in C++
- 8:49Spatial safety definition
- 13:19Compiler modes for safety
- 28:23Temporal safety challenges
- 41:53Lifetime safety in Clang
- 56:40Null pointer safety
- 1:06:51Nullability contracts at scale
- 1:17:37Dynamic tools for safety
- 1:20:46AI in safe C++ migration
- 1:21:49Conclusion
related talks
01h 00mStatic Analysis and Program Safety in C++: Making it Real
54mType-and-resource Safety in Modern C++
01h 02mTowards Safety and Security in C++26
43mEverything I learned about static analysis and program safety in C++
01h 02mTowards Correctness, Safety and Security in C++26
01h 03mLifetime Safety in C++: Past, Present and Future
01h 12mEnhancing Spatial Safety: Better Array-bounds Checking in C (and Linux)
01h 02mModern C++ Safety and Security At 20
