3 ms·
I agree with this. Having it declared once and letting the compiler handle it would be more convenient and invite fewer errors than requiring the programmer to
by Findecanor 5y ago
I agree with this. Having it declared once and letting the compiler handle it would be more convenient and invite fewer errors than requiring the programmer to insert a conversion every time the variable needs to be read or written.
Endianness in bitfields is not straightforward though.
- bruce343434 5y agoyou're right, and I'm still struggling with how to do this syntactically in a way that makes sense.
- tjalfi 5y agoIf you're looking for prior art, Ada has the Bit_Order and Scalar_Storage_Order attributes[0]; the latter is a GNAT extension. [0] https://www.adacore.com/gems/gem-140-bridging-the-endianness-gap https://www.adacore.com/gems/gem-140-bridging-the-endianness...