Practical Tips for Safer C++
summary
Shows concrete defenses: use -ftrapv / -fwrapv or -fsanitize=signed-integer-overflow,unsigned-integer-overflow to catch/define integer UB (trap in debug, wrap in release), or use libraries like SafeInt, Boost.SafeNumerics or flux for checked math; prefer std::strong_order for NaNs; use .at or a generic bounds-checked helper (span::at lands in C++26) or iterator-free algorithms to avoid OOB; follow the law of exclusivity to avoid dangling references; use constexpr + static_assert and sanitizers; note 29% never write unit tests.
AI-written summary · about
chapters (6)
- 0:00Introduction to safety
- 2:39Understanding undefined behavior
- 8:03Numeric safety
- 28:26Bounds safety
- 41:21Memory safety
- 59:42Testing for safety
related talks
01h 02mPractical Tips for Safer C++
50mSecure development with C++ - Lessons and techniques
51mSecure Programming Practices in C++
01h 00mint != safe && int != ℤ
33mUndefined Behavior in C++: What Every Programmer Should Know and Fear
01h 04mHarnessing constexpr: a path to safer C++
01h 26mVulnerable C++
48mSecure C++ Programming
