Remix.run Logo
▲ eesmith 3 hours ago

I .... okay, my mind is blown. It absolutely says that, and https://en.cppreference.com/cpp/language/types adds "this allows the extreme case in which bytes are sized 64 bits, all types (including char) are 64 bits wide, and sizeof returns 1 for every type."

So that scaling factor is placed into CHAR_BIT, and would be 64 on that DSP compiler.

> An object shall have its stored value accessed only by an lvalue that has one of the following types:

Yes, my confusion comes down to my confusion of what "byte" means in the C spec.

Thank you for your time in pointing this out.

▲aw1621107 an hour ago | parent [-]

Yeah, it's one of those things that is not exactly intuitive if you didn't already know about it. The menagerie of other byte-ish-sized types added in recent versions of C and C++ probably doesn't help either.

Bit of a (not so?) fun fact: char* being a universal alias can lead to some potentially unexpected slowdowns [0], especially if the char* bit is behind a typedef.

[0]: https://travisdowns.github.io/blog/2019/08/26/vector-inc.htm...