Christian Grothoff <[email protected]> writes: > This looks indeed perfect to me, modulo possibly one issue that is > totally unrelated to the design and more like a legacy bug you're copying: > https://en.wikipedia.org/wiki/Endianness#Floating_point > implies that we should actually also do network byte order conversions > on double and float, instead of copying them 1:1 into the byte stream. > But that is an _existing_ bug in BIO I just noticed while reading your > patch ;-).
Yeah, I simply copied the I/O on float/double instead of dealing with endianness. To begin with, since BIO is relatively old, I assumed there was already some talk about this and I though simply dropping the bytes as-is was something people agreed upon at some point in time; the other reason is that changing the underlying representation would break already-existing serializations and I don't know if that's ok. Should I change the float/double API to serialize the numbers into network byte order? (Hopefully there's a function in libc for this...) > Otherwise, very nice. The BIO part is IMO ready, but obviously the rest > of the code needs to be (slightly) adjusted to match the API change > before we can merge this. Great! Then I'll (slowly, since it's rather big) change the rest of the codebase to account for the new API, then reply back to this conversation with the full patch (tests included of course.) Thanks, A.V.
