Rules 11.4 and 11.5: addressing only explicit cast ?

6.11 Pointer Type Conversions

Moderators: misra-c, david ward

Posts: 9
Joined: Mon Oct 31, 2005 12:47 pm

Rules 11.4 and 11.5: addressing only explicit cast ?

Post by lv » Thu Oct 19, 2006 1:06 pm

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.

Posts: 566
Joined: Thu Jan 05, 2006 1:11 pm

Post by misra-c » Wed May 09, 2007 4:35 pm

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.
Posted by and on behalf of
the MISRA C Working Group


Return to “6.11 Pointer Type Conversions”