------- 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

Reply via email to