3 ms·
Cool. So on that platform CHAR_BIT was 16. I still wonder if those statements should use the plain non-typed sizes, or if no such were available. I can live wit
by unwind 4y ago
Cool. So on that platform CHAR_BIT was 16. I still wonder if those statements should use the plain non-typed sizes, or if no such were available. I can live with
sizeof(char) == 1
sizeof(short) == 1
sizeof(void *) == 1
all being true with CHAR_BIT equal to 16, but it seems pointless to support uint8_t if it's not truly 8 bits.
Too far from my language-lawyer mood now to dig deeper. :)
- rkangel 4y agoIt turns out you're right, and that's how I've actually written these examples in the past. A sibling comment provided a citation, and that I should really have been writing uint_leastXX_t: https://en.cppreference.com/w/c/types/integer https://en.cppreference.com/w/c/types/integer