A Guide to Undefined Behavior in C and C++