Accessing inactive union member and undefined behavior?
The confusion is that C explicitly permits type-punning through a union, whereas C++ (c++11) has no such permission. c11 6.5.2.3 Structure and union members 95) If the member used to read the contents of a union object is not the same as the member last used to store a value in the object, the appropriate … Read more