Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 12.2: Accessing volatiles in simple assignment statemnt
#7
I understand the idea behind the evaluation of several volatile variables done in an assignent statement, namely that reading one of them may cause a side-effect on another (volatile or non volatile) variable or on itself.

However they are all using simple assignments (in the sense ISO §6.5.16.1).
To be very precise about the rule to be implemented: any simple assignment that involves a volatile variable should be of the form x = v; with only the volatile variable on the rhs expression. Therefore x=v+1; is (strictly speaking) non compliant.
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)