09-10-2015, 11:49 AM
The essential type rules cover arithmetic types, not pointer types. The second paragraph of 8.10.1 of the MISRA C:2012 guidelines states
However, the MISRA-C working group has agreed that this is an omission (which was covered in MISRA-C:2004) and the following words will be added to the amplification to rule 10.1 in a future Technical Corrigendum.
Quote:The essential type model does this by allocating an essential type to those objects and expressions which ISO C considers to be of arithmetic type.Rule 10.1 is therefore not applicable to the ! operator when it has a pointer operand.
However, the MISRA-C working group has agreed that this is an omission (which was covered in MISRA-C:2004) and the following words will be added to the amplification to rule 10.1 in a future Technical Corrigendum.
Quote:In addition, the rule prohibits the use of logical operators ( ! && || ) with pointer operands.
Posted by and on behalf of the MISRA C Working Group