Modifying a variable through a pointer of an incompatible type (other than unsigned char
) can lead to unpredictable results. Subclause 6.2.7 of the C standard Standard mentions that two types may be distinct yet compatible , and addresses precisely when two distinct types are compatible.
...