[Bug c/18814] Incorrect reinitialization of compound literal
austern at apple dot com
gcc-bugzilla@gcc.gnu.org
Fri Dec 3 20:22:00 GMT 2004
------- Additional Comments From austern at apple dot com 2004-12-03 20:22 -------
I don't think this is the most natural interpretation. The line
p = &((int) {1});
sets p to the address of the literal, and at the point we reach it for the second time the literal itself has
been changed.
It might be useful to get an explicit ruling from the C committee, though. The whole idea of changing
literals is sufficiently odd that it's hard to even talk about this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18814
More information about the Gcc-bugs
mailing list