4 ms·
The strict aliasing violation is incidental. You can change int8_t to char in the code and get the same result with no strict aliasing violation.
by bobbyi 4y ago
The strict aliasing violation is incidental. You can change int8_t to char in the code and get the same result with no strict aliasing violation.
- gpderetta 4y agoSure, as per my other comment, it then would be an object representation violation. Even ignoring both rules, there is still no reason to expect the assertion not to fire: int x = 2; assert(*(bool*)x == true); This is the same as: float x = 2.0 assert(*(int*)x == 2); Just because two object are convertible, there is no reason to expect their representation to be the same.