Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Explore undefined behavior (UB) in C++ from the compiler's unique perspective in this comprehensive conference talk that demystifies one of the most misunderstood aspects of the language. Examine what undefined behaviors actually are, how compilers process and optimize around them, and understand why they pose significant dangers to code reliability and security. Learn about the two common but flawed attitudes toward UB - treating it as either an insurmountable threat or dismissing it as irrelevant - and discover a more nuanced understanding based on compiler implementation details. Investigate C++'s problematic approach to handling undefined behavior and explore potential solutions that both the language specification and compiler implementations could adopt to make development safer and more predictable. Gain insights into why UB exists in the first place, why it continues to be used despite its risks, and what practical steps can be taken to mitigate its dangers while still leveraging its performance benefits. Understand the technical mechanisms behind compiler optimizations that assume undefined behavior never occurs, and learn how these assumptions can lead to unexpected program behavior even in seemingly safe code.
Syllabus
Undefined Behavior From the Compiler’s Perspective - Shachar Shemesh - C++Now 2025
Taught by
CppNow