Summary
This episode reveals a surprising aspect of C++ where infinite loops were undefined behavior before C++26, allowing compilers to make aggressive optimizations. Jason demonstrates how Clang would completely eliminate infinite loops and their containing functions, potentially causing code to fall through into unrelated functions in the binary. As of C++26, infinite loops are no longer undefined behavior, so compilers must preserve them, making this historical quirk a thing of the past.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[c.files]40% match