Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 13.3 - Using ++/-- with a volatile variable in C
#1
Hello, 
I saw in a previous post (https://forum.misra.org.uk/showthread.php?tid=1302), it was discussed that 
Code:
volatile int x = 0;
x++;
where x is declared as volatile is a violation of rule 13.3 and changing this to be 
Code:
x += 1;
results in compliance with rule 13.3. Would someone be able to explain why this is the case?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)