Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 18.4, 10.1, and the "type" of pointer to object
#2
The essential type rules cover arithmetic types, not pointer types. The second paragraph of 8.10.1 of the MISRA C:2012 guidelines states
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)