Concerning this question
Convert from uint8_t * to char * in C
The suggestion was simply to cast with (char*). Why is this acceptable in this context? Or did the responder just take the question literally?
Casting unsigned (depending on the implementation) to signed feels dubious.
In C, it is allowed to access a variable of a given type through a pointer to the signed or unsigned version of that that type.
This is specified in section 6.5p7 of the C standard:
A
uint8_tis an alias for anunsigned char(at least, on systems whereCHAR_BITis 8), so it is allowed to convert anuint8_t *to achar *and subsequently dereference the resulting pointer.Note also that, per the last bullet point above, using a pointer any character type is allowed to access any kind of object.