Re:C Portability Lessons from Weird Machines
by int_19h on Thursday November 15, 2018 @11:00PM
(#18466279)
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:
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.
[ Parent
| on HN ]
Re:C Portability Lessons from Weird Machines
by hamiltonkibbe on Friday November 16, 2018 @12:54AM
(#18466746)
16- 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.
Re:C Portability Lessons from Weird Machines
by 0xcde4c3db on Friday November 16, 2018 @08:31AM
(#18468572)
> 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].