13-10-2010, 07:29 AM
Hi,
It's the first Misra compliant project I'm involved in and I've some troubles to understand some rules. On in particular is rule 12.4. I've some expression like
where REGISTER is a deference to a volatile pointer (represents the content of a microcontroller register) declared as following:
The right and of && doesn't comply to rule 12.4 because of the volatile access. I don't understand why reading a volatile content is not Misra compliant. The problem is that registers access are defined as volatile and I don't know how to overcome this to make my statement compliant.
Thanks for your help.
It's the first Misra compliant project I'm involved in and I've some troubles to understand some rules. On in particular is rule 12.4. I've some expression like
Code:
if (xxx && REGISTER)
Code:
#define REGISTER (*((uword volatile *) 0xEA2CU))
The right and of && doesn't comply to rule 12.4 because of the volatile access. I don't understand why reading a volatile content is not Misra compliant. The problem is that registers access are defined as volatile and I don't know how to overcome this to make my statement compliant.
Thanks for your help.
<t></t>