02-09-2010, 08:34 AM
Just another question on the volatile variables in this rule, as I am implementing the MISRA C 2004 rules for a static analyser (www.frama-c.com). If I interpret the rule literally I have the following:
volatile int v=4;
int x=5;
v+=3; // Not compliant
v=x; // Compliant
x=x+v; // Compliant
x+=v; // Not compliant
x=v+v; // Compliant
Is this correct?
Shouldn't the last assignment be NOT compliant as its rhs causes a side effect?
volatile int v=4;
int x=5;
v+=3; // Not compliant
v=x; // Compliant
x=x+v; // Compliant
x+=v; // Not compliant
x=v+v; // Compliant
Is this correct?
Shouldn't the last assignment be NOT compliant as its rhs causes a side effect?
<t></t>