Hacker News new | past | comments | ask | show | jobs | submit login

These this are much more complicated to define then you think when you consider the kinds of strange hardware C supports, where bytes are not 8 bits and things like that. We tried to get endian-ness conversion functions in to c23 but ran out of time just because defining these functions so that their functionality is clear on non standard hardware is so difficult.



It would have been reasonable to define the functions only for the CHAR_BIT == 8 case, and if any implementers that support weird architectures want the functionality let them come forward with a proposal. I got the impression that the people working on the proposal got into an avoidable mess of complications.


Given that weird platforms are so dependent on C and since we release versions so infrequent, we try to get it right the first time. Often even defining what is excluded becomes complicated.


if C throws away portability it is no longer C


C's secret to portability is called #ifdef spaghetti and mostrosities like autoconf.


oh, I didn't see that byteswap wasn't in there. I googled the "stdc_" part and saw a paper that included byteswap. I guess that was an older draft.

Damn, so close. Well I hope it's included next time.


I'll do my best to get ror/rol and byteswap in!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: