2 ms·
What I mean is that this is perfectly valid code: uint64_t x=0; uint8_t * p = (uint8_t*)&x; uint64_t y = *(uint64_t*)p; It is not the casting that is
by gpderetta 3y ago
What I mean is that this is perfectly valid code:
uint64_t x=0;
uint8_t * p = (uint8_t*)&x;
uint64_t y = *(uint64_t*)p;
It is not the casting that is the problem, it is the dereferencing. And as long as that matches the dynamic type, it is ok.