13-12-2013, 09:06 AM
The short answer is "one".
A cast from "cv1 Type1 *" to "cv2 Type2 *" will only be compliant with this rule if Type1 and Type2 are the same, including their cv-qualifiers. However the cv-qualifiers ( cv1 and cv2 in your example ) at the top level may differ.
[Note: exceptions apply for casts between pointer to objects and pointers to char, signed char or unsigned char.]
A cast from "cv1 Type1 *" to "cv2 Type2 *" will only be compliant with this rule if Type1 and Type2 are the same, including their cv-qualifiers. However the cv-qualifiers ( cv1 and cv2 in your example ) at the top level may differ.
[Note: exceptions apply for casts between pointer to objects and pointers to char, signed char or unsigned char.]
Posted by and on behalf of the MISRA C Working Group