~/talk

Signed integers are two's complement

Talkat CppCon 2018 · 2018-09-23..09-28· [c-and-cpp]
github:jfbastien
slides:none on file

Claim: signed integer storage is narrowed to one true representation: two's complement, while arithmetic semantics (overflow) remain unspecified for now. Evidence comes from a hardware survey, GCC optimization analysis and real-world bug examples; proposed change becomes a committee paper and spawns library work such as __builtin_add_overflow / UBSan usage. Measured compiler cost of forbidding overflow-based optimizations is about 12% geomean perf hit with ~1% size increase, so the standard keeps wrapping undefined but tightens representation.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 0:22Signed integers representations
  3. 3:55Undefined behavior in practice
  4. 10:41Clever but broken workarounds
  5. 14:35Builtins for overflow checks
  6. 14:55Famous integer overflows
  7. 24:28Linus Torvalds on undefined behavior
  8. 28:25Why change the standard
  9. 30:12Binary number systems history
  10. 35:50Modern hardware survey
  11. 36:56Storage vs arithmetic in two's complement
  12. 38:20Arguments against defining overflow
  13. 41:58Performance impact of overflow rules
  14. 43:47Alternative integer types in other languages
  15. 48:01Proposing changes to the committee
  16. 51:13Committee feedback and next steps
  17. 53:04Changes in the standard
  18. 55:51Future simplifications
  19. 56:12Q&A session
~/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.