Forum Navigation
ByteSwap swap80 assumes real has size 10
Posted: 09/22/07 11:29:27I just noticed that swap80 in ByteSwap? is written to swap exactly 10 bytes, but uses real.sizeof when decrementing the byte count. Also, the endian protocol uses swap80 for reals.
With my current setup (dmd on an AMD64 linux system) I get told reals have size 12 - aren't there going to be problems if endian swapping is used here? Besides which, the spec simply says a real uses the largest size fitting into hardware, with a note saying this is 80 bits on intel CPUs, so even if a real always was 10 bytes on current systems, that could change in the future. (Also surely 32bit CPUs don't support 10byte reals?)
The reason I didn't post a ticket though is because I'm not really certain this is a problem; e.g. if despite reals having size 12 on my system only the first 10 bytes are used.