It's a legal trick that doesn't actually work. Sega tried the same trick and lost when they took it to court in 1992. https://en.wikipedia.org/wiki/Sega_v._Accolade
Casting pointers is well defined. What is undefined behavior is to dereference a pointer whose type does not match the pointed-to object.
It's a legal trick that doesn't actually work. Sega tried the same trick and lost when they took it to court in 1992. https://en.wikipedia.org/wiki/Sega_v._Accolade
Casting pointers is well defined. What is undefined behavior is to dereference a pointer whose type does not match the pointed-to object.