Hacker News new | ask | show | jobs
by simias 1702 days ago
I don't understand, if you're trying to work around aliasing restrictions why would you use `uint8_t*` in the first place?

By definition `sizeof(char) == 1`, so that's almost always what you want when messing with types in C anyway. What you want is bytes, not octets.

1 comments

chars can be two octets on some DSP platforms that lack byte addressability.
sizeof(char) must always be 1, regardless of how many bits or octets that represents. On such a platform, uint8_t does not exist.