Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
13.1 when initializing with address of volatile variable
#3
misra-c Wrote:All your examples are compliant with rule 13.1. Taking the address of a volatile variable is not a "persistent side effect".

In the &REG1 and &REG2.bar examples, neither the & or * operator are evaluated - see C99 6.5.3.2(3).
For example: &(*(volatile uint16_t *)0x100) is equivalent to (volatile uint16_t *)0x100

I don't see how the exception in C99 6.5.3.2(3) applies in the case of &REG2.bar since the operand of the & operator in this case is the result of the member access operator, not the * or [] operators. Can you please clarify your position and/or rationale for this part of the example?
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)