It is no secret that C and C++ are chock-full of pitfalls of undefined behavior. The C++ standard describes it as: behavior for which this International Standard imposes no requirements Modern compilers, with optimizations on, often assume that undefined behavior is never invoked in the program and try to make sense of the code under that assumption. When a program actually does invoke undefined behavior, this conflicts with the assumption under which the compiler generated code, often result...