Will a void*
always have the same representation as a char*
?
Details:
I want to work with a variadic function tha
It's specifically allowed to access a void*
argument using va_arg(args, char*)
and vice versa, not just for the null pointer.
See also http://en.cppreference.com/w/cpp/utility/variadic/va_arg
C11, §6.2.5, ¶28 (draft N1570) says:
A pointer to void shall have the same representation and alignment requirements as a pointer to a character type. 48) Similarly, pointers to qualified or unqualified versions of compatible types shall have the same representation and alignment requirements.
(emphasis mine).