4 ms·
sizeof(char) is 1 per definition and also one byte, but not necessarily 8 bits. Apparently some DSPs cannot address an 8-bit quantity -- they're not easy to fi
by Erwin 15y ago
sizeof(char) is 1 per definition and also one byte, but not necessarily 8 bits.
Apparently some DSPs cannot address an 8-bit quantity -- they're not easy to find but I've found a comp.lang.c posting where Jack Klein mentions a 32-bit Sharp DSP with CHAR_BIT = 32 (so sizeof(char) == sizeof(int) == 1 !) and a Texas Instruments TMS32F28xx DSP with a 16 bit CHAR_BIT.
On such a system, C99 might not define int8_t but you could use int8_least8_t.
My guess is that they are more common than 64-bit ints but they might be supported by their own weird C Compiler/toolchain.
- caf 15y agoThe interesting thing about such architectures is that the common stdio idiom: int c; while ((c = getchar()) != EOF) { does not work properly on them.