~/talk

C++ Pitfalls and Sharp Edges to Avoid

Talkat CppNorth 2025 · 2025-07-21..07-23· [c-and-cpp, security]
slides:none on file

A string of concrete traps and fixes: a missing non-void return causes a timer callback to silently reschedule in production; a stray semicolon makes an if always execute; the comma operator plus default args silently misinitialize a Point; returning a reference from get_or_default yields a dangling ref; shared_ptr cycles leak; moved-from objects and SSO produce intermittent bugs; unspecified evaluation order breaks assumptions. Recommended tooling and settings: -Wall -Wextra -Wnull, use static analyzers and clang-tidy, run address/UB/runtime sanitizers both with and without optimization, plus strict code review and targeted refactors.

AI-written summary · about

  1. 0:00Introduction to C++ pitfalls
  2. 2:04Should we check for null
  3. 3:10Story of a production bug
  4. 7:00Essence vs accidental bugs
  5. 10:30Common accidental bugs in C++
  6. 13:01Safety nets for bug prevention
  7. 18:46Compiler warnings and static analysis
  8. 23:55Undefined behavior examples
  9. 25:44Dangling references in code
  10. 28:14Recurring bugs and solutions
  11. 30:44Polymorphism pitfalls
  12. 34:43Object slicing issues
  13. 35:49Memory leaks and cycles
  14. 37:38Dead stack variables
  15. 41:14Shadowing and variable scope
  16. 42:43Dangling references from moves
  17. 46:47Static initialization pitfalls
  18. 49:24Complex code and refactoring
  19. 53:23Unmaintainable code dangers
  20. 55:52State machines for clarity
  21. 59:30API assumptions and facades
  22. 1:05:17Invalidated iterators
  23. 1:07:47C++ language complexity
  24. 1:11:01Summary and best practices
  25. 1:18:30Q&A session
~/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.