On 06/03/10 15:54, John Regehr wrote:
>> I'm not sure this follows.  It's stated explicitly that "The
>> expression is evaluated and its value is discarded."  How can you
>> evaluate the expression without reading the volatle?
> 
> I'm certainly not an expert on this material but I wouldn't think you'd
> normally read a variable in order to evaluate it as an lvalue.  My guess
> is that evaluating the expression means computing the address for
> something like "*(p+1)".

Yes, I see your point.

>> Besides, all that changing this would do is break programs.
> 
> Well they're broken anyway since widely-used C++ compilers are choosing
> to not read the variable under these circumstances.  The obvious
> solution is "don't do that" but there's plenty of code doing this out
> there, and plenty of developers who need re-educating.

I guess.  Given that the semantics of volatile are implementation-
defined anyway, I can't see that this is a conformance issue.

Andrew.

Reply via email to