This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/18814] Incorrect reinitialization of compound literal
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Dec 2004 20:52:57 -0000
- Subject: [Bug c/18814] Incorrect reinitialization of compound literal
- References: <20041203183239.18814.austern@apple.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From joseph at codesourcery dot com 2004-12-03 20:52 -------
Subject: Re: Incorrect reinitialization of compound literal
On Fri, 3 Dec 2004, austern at apple dot com wrote:
> 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 sets p to the address - and executes the initializers, storing the
results in the literal. The initializers need not be constants; they may
(as in the example in the standard) be expressions that take on different
values at each execution.
I could add the issue to those I have for discussion for possible DRs at
the UK C Panel meeting on the 14th (although I think the standard is
clear, the fact that some people think it means something else indicates a
problem), but I don't have high hopes that this meeting will get as far as
discussing any of my previous issues rather than internal politics.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18814