Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Violation for rule 109
#2
The MISRA C Rule you refer to is from the 1998 version. It was replaced in 2004 by a new version, MISRA C2, and this is the only version that should be used for new projects.

The original Rule 109 has been split into two rules in MISRA C2, rules 18.2 and 18.3 so the answer will be given in relation to these rules. Rule 18.2 requires that objects are not assigned to overlapping objects and Rule 18.3 requires that an area of memory isn't used for unrelated purposes.

The existence of two pointers that point to the same address does not in itself violate either of the MISRA C2 rules. If the pointers are used to copy an object to an overlapping object then the rule is violated. Similarly if the pointers are used to access the memory for completely different purposes, the rule is violated although it is difficult for a tool to be able to check this case.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)