koorogi·10 anni fa·discussIt'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
koorogi·10 anni fa·discussCasting pointers is well defined. What is undefined behavior is to dereference a pointer whose type does not match the pointed-to object.
https://en.wikipedia.org/wiki/Sega_v._Accolade