Can an unsigned type always store the value of a signed type and vice versa? I mean not by arithmetic value but rather as "raw value".
Example:
// Generic Integer (without sign saved)
typedef uintmax_t generic_int;
int16_t p = -17;
// Store int16_t in a generic int
generic_int myint = (generic_int)p;
Later on...
// Get the signed value again
int16_t plater = (int16_t)(myint & 0xFFFFULL);
Is this always safe? Will the correct value of the original signed variable be restored in all cases?