Add XDR support (only built #if cygwin, for now)

Charles Wilson cygwin@cwilson.fastmail.fm
Fri Feb 26 18:52:00 GMT 2010


Corinna Vinschen wrote:
> If _DOUBLE_IS_32BITS is set, call xdr_float from xdr_double.

Hmmm...actually, I think this is wrong.  The XDR stream format of a
double is supposed to be universal, and is 8 bytes long. If I have an
incoming bytestream that represents a true double, I won't be able to
decode it using this technique.  Also, if I have a "double" and encode
it using -- effectively -- xdr_float(), then the receiving party,
knowing that it is supposed to be a double, will try to decode it using
xdr_double but will only have four bytes to work with.

I think in this case double support should just be removed.

--
Chuck



More information about the Newlib mailing list