Question:
Is there any c++ toolchain, where std::uint8_t
exists, but is not a typedef for unsigned char
(or char
, if it is unsigned)?
EDIT: Conversely: Is such a thing even possible in a standards conforming implementation?
Background / Motivation:
I'm mainly asking because I want to know if std::uint8_t*
can be used portably to access individual bytes (just like unsigned char*
). And yes, I'm aware of std::byte
, but thats not relevant here. I'm mainly interested in toolchains for x86, arm and mips, but out of curiosity I'd also like to hear about other examples.
char
is not an unsigned integer type, even if it is, in fact, unsigned. Since uint8_t
must be a unsigned integer type, it never can be char
.CHAR_BIT
must be at least 8, while the next smallest standard unsigned integer type, unsigned short
, must have at least 16 bits. If uint8_t
exists, then it must be "an unsigned integer type with width 8 and no padding bits." If uint8_t
denotes a standard unsigned integer type, then it can only be unsigned char
.uint8_t
from denoting an implementation-defined extended unsigned integer type. I don't know of any implementations that do this, however.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With