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 y
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 evalua
On 03/06/2010 04:43 AM, John Regehr wrote:
> The question is, what should C and C++ compilers do with this code?
>
> volatile int x;
>
> void foo (void) {
> x;
> }
>
> This question is not totally stupid: embedded systems use code like this
> when reading a hardware register has a usef
The question is, what should C and C++ compilers do with this code?
volatile int x;
void foo (void) {
x;
}
This question is not totally stupid: embedded systems use code like this
when reading a hardware register has a useful side effect (usually
clearing the register).
It is reas