18-10-2018, 01:00 PM
All your examples are compliant with rule 13.1. Taking the address of a volatile variable is not a "persistent side effect".
In the ®1 and ®2.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
In the ®1 and ®2.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
Posted by and on behalf of the MISRA C Working Group