Re:Tell HN: C Experts Panel – Ask us anything about C
by DougGwyn on Tuesday April 14, 2020 @04:57PM
(#22871347)
Note that the ABIs cover endianness as well as value range and/or object widths. In general, one needs to have explicit marshaling and unmarshaling functions to map from network octet array and C internal data representation.
Failure to get this right is (or used to be) a common bug for code developed and tested on too few architectures.
[ Parent
| on HN ]
Re:Tell HN: C Experts Panel – Ask us anything about C
by quelsolaar on Tuesday April 14, 2020 @05:25PM
(#22871648)
Sure, it wont be portable between any architectures, but a lot of times you know you will be on a little endian platform where types are aligned to their sizeofs. That covers a lot of ground and the performance gains you get from optimizing with this in mind is significant. There is value in C being able to be portable, but there is also a huge value in being able to write non-portable code that takes advantage of what you know about the platform. C needs to acknowledge that that is a legitimate use case.