This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]