Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 13.3 - Using ++/-- with a volatile variable in C
#2
Accessing a volatile has potential side effects, beyond the simple read operation - hence the violation of Rule 13.3.

x += 1 does not violate Rule 13.3, because that Rule explicitly only applies to ++ and --, and not to += or -=
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread
RE: Rule 13.3 - Using ++/-- with a volatile variable in C - by misra-c - 10-07-2025, 01:08 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)