...
According to C99 Section 6.3.2.3 p7 (see also undefined behavior 22 of Annex J):
A pointer to an object or incomplete type may be converted to a pointer to a different object or incomplete type. If the resulting pointer is not correctly aligned for the pointed-to type, the behavior is undefined.
...