4 ms·
One thing that they didn't list there that probably deserves a mention is SHARC with its 32-bit word architecture, which they decided to manifest directly in C
by int_19h 8y ago
One thing that they didn't list there that probably deserves a mention is SHARC with its 32-bit word architecture, which they decided to manifest directly in C type sizes:
CHAR_BIT == 32
sizeof(char) == 1
sizeof(int) == 1
sizeof(short) == 1
sizeof(float) == 1
sizeof(double) == 2
I suppose the alternative would be to use an addressing scheme encoding bit offset in the pointer, like some of the other machines in this story. But that's also much more expensive, and this is a DSP architecture, so they went with something more straightforward. Curiously, this set-up is still fully accommodated by ISO C standard.
- romed 8y agosizeof(double) is 1 if you're using Analog's compiler. You have to use --double-size-64 to get the bigger one.
- hamiltonkibbe 8y ago16- or 32-bit chars are pretty common on DSPs from any vendor. I’ve found that it’s usually only an issue with some cross-platform serialization libraries that make invalid assumptions about how an array of octets looks in memory.
- 0xcde4c3db 8y ago> Curiously, this set-up is still fully accommodated by ISO C standard. This allegedly means that the standard doesn't require fgetc() (which returns a char converted to an int on success, or EOF on failure) to have sensible behavior on such platforms [1]. [1] https://stackoverflow.com/a/3861506 https://stackoverflow.com/a/3861506