hackertube.io

CppCon 2016: Chandler Carruth “Garbage In, Garbage Out: Arguing about Undefined Behavior..."

CppCon · talk · Watch on YouTube

What it is

Chandler Carruth's CppCon 2016 talk tries to defuse the heated debate over undefined behavior in C and C++. He explains from the compiler writer's perspective why UB exists and how it enables optimization.

Why Hacker News recommends it

HN points to it whenever undefined behavior comes up, as the best explanation of the reasoning behind UB, though some dispute its framing.

  • 4 people recommended it
  • 4 different months
  • 0 strong recommendations
  • first 2016, last 2026

What HN commenters said

  1. “CppCon has also had a lot of great talks on UB and why it is what it is”

    CppCon talk on why undefined behavior exists.

    kllrnohj, 2018-03 · Recommendation · in “A Usable C++ Dialect That Is Safe Against Memory Corruption”

  2. “Chandler Carruth's talk on the subject was really useful for my own understanding of the reasoning behind UB”

    Explains the reasoning behind undefined behavior.

    lyricaljoke, 2018-05 · Recommendation · in “Depressing and faintly terrifying days for the C standard [pdf]”

  3. “I encourage to watch the full talk but here is one relevant example”

    Explains why signed overflow aids bug-catching; Google experiment included.

    Joky, 2018-11 · Recommendation · in “Trip report: Fall ISO C++ standards meeting”

  4. “here's a very clear-cut example[1] where emitting a warning would be bad.”

    Clear-cut example where warning on UB would be bad.

    moefh, 2023-08 · Recommendation · in “A Guide to Undefined Behavior in C and C++”

Excerpts from Hacker News comments, linked to the originals. Summaries and labels were written by a language model from those comments.

Topics: undefined behavior, c++, compilers, optimization, signed overflow, llvm

Also recommended by the same people