R
regis
Hello,
In the rationale, section [3.2.2.3 Pointers] states:
====
# A pointer to void may be converted
to a pointer to an object of any type.
# A pointer to any object of any type may be converted
to a pointer to void.
# If a pointer to an object is converted to a pointer to void and back
again to the original pointer type, the result compares equal to
original pointer.
# It is invalid to convert a pointer to an object of any type to a
pointer to an object of a different type without an explicit cast.
====
Does the last item imply that the following is invalid ?
int i= 666,
int * pi= & i;
void * pv= pi;
unsigned char * puc= pv;
At the sight of the first two items, I would say it is legal,
but the last item makes me doubt...
In the rationale, section [3.2.2.3 Pointers] states:
====
# A pointer to void may be converted
to a pointer to an object of any type.
# A pointer to any object of any type may be converted
to a pointer to void.
# If a pointer to an object is converted to a pointer to void and back
again to the original pointer type, the result compares equal to
original pointer.
# It is invalid to convert a pointer to an object of any type to a
pointer to an object of a different type without an explicit cast.
====
Does the last item imply that the following is invalid ?
int i= 666,
int * pi= & i;
void * pv= pi;
unsigned char * puc= pv;
At the sight of the first two items, I would say it is legal,
but the last item makes me doubt...