3 ms·
One small argument for little endian is that if you have a pointer void* then in little endian format you can interpret it as a int8_t*, int16_t*, etc. (or char
by quietbritishjim 5y ago
One small argument for little endian is that if you have a pointer void* then in little endian format you can interpret it as a int8_t*, int16_t*, etc. (or char*, short*, etc. in old money) and get the same numerical value if the number is small enough that it fits into all the types you try. I don't think that has much practical use but it does have a nice feel about it.
- daenz 5y agoSounds like a footgun to me
- bonzini 5y agoIt means for example that a bitmap is the same no matter if its code accesses it in groups of 8/16/32/64 bits.
- daenz 5y agoI get it, but it also means values will appear to be correct, instead of obviously wrong, if the data is cast without concern for the value range. Then one day someone enters a value and exceeds that range and BOOM