~/lightning

Lightning Talk: Your Favorite Undefined Behavior in C++

Lightningat C++Now 2023 · 2023-05-07..05-12· [c-and-cpp]
github:jfbastien
slides:none on file

Rapid-fire audience-sourced catalog of concrete C++ undefined behaviors with examples and surprising edge cases: macro expanding to the token "defined", infinite loops as UB, signed integer overflow and unsigned-promotion surprises for unsigned short multiplication, unions and bitcast UB, memcpy of zero is UB, taking addresses of standard-library functions, templates with no valid instantiation, casting away const, uninitialized stack variables, specializing standard templates (numeric_limits), object lifetime violations, and relaxed-atomics “out of thin air” values.

AI-written summary · about

  1. 0:00Undefined behavior in C++
  2. 0:23Audience favorites
  3. 1:07Macros and unsigned integers
  4. 2:11Unions and type punning
  5. 3:18Overflow and library contracts
  6. 4:23Templates and const casting
  7. 5:50Uninitialized variables
  8. 6:52Integer shifting
  9. 7:34Stack overflow
  10. 8:17Compiler diagnostics
  11. 9:19Stack Overflow questions
  12. 9:40Function declarations
  13. 10:43Undefined behavior in the preprocessor
  14. 11:06Register keyword
  15. 11:49Arrays to function pointers
  16. 12:11Numeric limits specialization
  17. 13:19Trivial types
  18. 14:01Atomics and memcopy
  19. 14:44Object lifetime bypass
  20. 15:52Library specialization rules
  21. 16:33Relaxed atomics
  22. 17:46Out-of-thin-air values
  23. 18:06Closing remarks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.