MISRA Discussion Forums
Rules 11.4 and 11.5: addressing only explicit cast ? - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA-C: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17)
+---- Forum: 6.11 Pointer Type Conversions (https://forum.misra.org.uk/forumdisplay.php?fid=38)
+---- Thread: Rules 11.4 and 11.5: addressing only explicit cast ? (/showthread.php?tid=319)



Rules 11.4 and 11.5: addressing only explicit cast ? - lv - 19-10-2006

Theses both rules (11.4 and 11.5) prevents against bad casting between pointers.


In my understanding, these both rules are applicable for explicit and implicit cast: The problematic is the same for explicit or implicit cast.


The understanding of my MISRA-checker-tools is that these rules address only explicit cast (these rules give only explicit cast example, and anywhere implicit cast is mentioned).
And this pointer implicit cast is not covered by another MISRA rule (Rules 10.1 and 10.2 don't address pointers cast but only integer and float implicit casts.)

Could you confirm which understanding is the good one?

Thanks in advance.


- misra-c - 09-05-2007

Any attempt to perform an implicit conversion involving a pointer (other than pointer to void) is not legal C and is therefore a violation of rule 1.1.