~/talk

Practical Tips for Safer C++ Programs

Talkat C++Online 2025 · 2025-02-26..02-28· [c-and-cpp]
slides:none on file

Practical, concrete fixes: signed integer overflow is UB so use compiler flags like -fwrapv or trap with -fsanitize=signed-integer-overflow (and -fsanitize=unsigned-integer-overflow for logical bugs), expect slower vectorization when trapping, and run ASan/MSan/TSan during tests. Bounds checks via .at(), custom checked access, or eliminate indexing with algorithms; std::strong_order prevents UB when sorting floats with NaNs. Enforce compile-time checks with consteval/static_assert to catch UB early — 29% of C++ devs report no unit tests, so test with multiple compilers and sanitizers.

AI-written summary · about

  1. 0:00Introduction to safer C++
  2. 1:51What is safety in C++
  3. 9:46Numeric safety in C++
  4. 29:46Bound safety in C++
  5. 39:32Memory safety challenges
  6. 56:42Testing for safer C++
  7. 1:03:44Summary and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.