2 ms·
> my question was whether int8_t* and char* are interchangeable They are not. Not every "C" compiler complies with whatever standard you care to cite. There
by topspin 8y ago
> my question was whether int8_t* and char* are interchangeable
They are not. Not every "C" compiler complies with whatever standard you care to cite. There are DSP platforms[1], for instance, where char is 16 bits. Obviously any hypothetical pointer arithmetic on such a platform must differ between (u)int8_t and char.
The intent of (u)int8_t is that such a platform will either a.) correctly implement (u)int_8 and operate on exactly 8 bits as intended or b.) fail to compile. This is demonstrably different than assuming char is 8 bits and yet compiling when it is not.
[1] for sale here: https://www.digikey.com/en/product-highlight/t/texas-instruments/c2000 https://www.digikey.com/en/product-highlight/t/texas-instrum...