[Bug c/82340] volatile ignored in compound literal
pascal_cuoq at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Sep 27 10:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82340
--- Comment #2 from Pascal Cuoq <pascal_cuoq at hotmail dot com> ---
Richard:
> I don't see how a volatile compound literal could make any sense or how you'd observe the side-effect of multiple stores to it
Well, I have the same question about volatile variables the address of which is
not taken. But this is off-topic for this bug report, in which the volatile's
object's address is taken.
> (IIRC compound literals are constant!?).
The C11 standard invites the programmer to use the const qualifier if they want
a constant compound literal, and gives an explicit example of a “modifiable”
non-const compound literal: https://port70.net/~nsz/c/c11/n1570.html#6.5.2.5p12
More information about the Gcc-bugs
mailing list