[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network number scheme/Dead list?



  
  This used to be the case but not anymore. Our main product here uses
  rpc and shares data across platforms extensivly and all was fine until
  the new generation machines arrived (Dec Alpha particularly). Our main
  problem was if you use long ints (which normally used to be 32bits)
  everything goes haywire, since the Alpha uses 64bit long ints.  Ok we
  could have programed around this without xdr, but if you wan't to be
  sure data is correctly passed between current machines _and_ any future
  machines I think you really should convert to xdr format and then
  convert back at the other end.
  
  Dave Halliday

I don't see how XDR solves this problem. If I use a 64-bit long on an
Alpha there's no way I can send it to a long on a 32-bit machine, with
or without XDR, without losing 32 bits of the number. The issue of word
size is completely separate from network (or eXternal) Data Representation.
The correct solution to your problem may be painful; traditionally Unix
programmers have gotten away with being lazy about long/int distinctions,
but that's a different problem. (E.g., your int vs long problem on the
Alpha is a problem regardless of the presence or absence of a network.
Likewise on a Cray, which uses 64 bits for longs *and* ints...)
  -- Howard