On 2016-09-26 17:28:38 +0300, Alexander Monakov wrote: > I concede the original example may invoke UB if the first write to > malloc'ed region determines its type until free(). No, the effective type is determined by the last write, not the first one. The C standard says (6.5#6): "[...] the type of the lvalue becomes the effective type of the object for that access and for subsequent accesses that do not modify the stored value." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ So, the effective type of an object is allowed to change. -- Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)