No, that clause makes no such guarantee.
Now, in practice, the most common issue would be alignment: but even that may be rare.
The second problem would involve strict aliasing, where memory allocated as a double
can be assumed by the compiler to not be modified by any operation involving pointers to other types (except char
). The above places a restricition going the other way (a complex
allocated pointer may not assume thay double*
s do not point to its data), but not in the direction you want. Again this is relatively obscure, but a compiler could use this to reorder writes in your code.
It will, however, usually work. More often if you align it, and your compiler does not use strict aliasing assumptions: even then it is undefined behaviour by the standard, however.