- Joined
- Feb 8, 2021
I don't recall whether uintn_t in particular has weird rules about padding and aliasing, but I'm still pretty sure this is undefined behavior due to possible struct padding. Even if it was merely implementation-defined behavior, in any real little endian implementation, these two functions also do different things.View attachment 6202565
It is much faster to read/write data for one, for another, it does clean up your code on the use end quite a bit. Also, what little 'reflective' capability C has does somewhat necessitate this approach.
E: I forgot to update the thread before posting so I'm late and gay, but whatever.