08-01-2008, 12:35 PM
In the mc2_1102.c file there is a following example:
Is the conversion between void pointer and a float type object disallowed by the 11.2 rule?
According to my understanding the rule 11.2 disallows conversions only if we are converting to or from a pointer to object.
float type is clearly not a pointer to object type.
Pointer to void is not a pointer to object type, because void is not an object (it's an incomplete type).
Please correct me if my understanding is not correct.
Code:
float32_t float32_1102;
void *void_ptr = ( void * ) get_int32_ptr ( );
float32_1102 = ( float32_t ) void_ptr; /* Not Compliant */
Is the conversion between void pointer and a float type object disallowed by the 11.2 rule?
According to my understanding the rule 11.2 disallows conversions only if we are converting to or from a pointer to object.
float type is clearly not a pointer to object type.
Pointer to void is not a pointer to object type, because void is not an object (it's an incomplete type).
Please correct me if my understanding is not correct.