Portability and alignment constraints

William E. Davidsen Jr davidsen at steinmetz.ge.com
Tue May 24 01:37:22 AEST 1988


In article <11567 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>In article <10886 at steinmetz.ge.com> davidsen at steinmetz.ge.com
>(William E. Davidsen Jr) writes:

  ...A lot of my stuff, commented...

>Exchanging binary data has more than just alignment problems: aside
>from integer endian-clashes, there are a multitude of floating point
>formats.  Not even the number of bits per byte is fixed.  Portable
>programs rely on some other method of exchanging data (RPC library,
>ASCII interchange, etc.).

The portable method of writing binary data is to output a series of
bytes, each containing 8 bits of data, LSB first. On a 32 bit 2's
complement machine this is natural. On other machines it is doable. I
have written portable data files on a Cray which may be read on a PC
using BASIC. It gets *real* ugly on a 1's complement machine, but in no
way undoable in portable C. Bit per byte is usually fixed by the data
transfer program, using a file transfer protocol or mag tape. I've sent
the data to a DEC-20, which I *think* is 36 bits, using the tenex FTP
mode.

My point here is not that you are wrong, but that the problem is
resolvable without vast trickery, and that there are some of us who are
doing it.

>As long as the claim is only `I do not like it', I shall stand aside.
>I am not unsympathetic---I had to fix numerous Vaxisms in Gosling Emacs
>when we first got our Pyramid (one of those that did not support
>*(long*) unless the address was 0 mod 4); finding all of these was no
>fun at all---but when someone claims that the machine is `broken', or
>does not abide K&R, or various other falsehoods, I will post
>corrections.
>-- 
>In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
>Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris

I've been known to correct a posting containing bad info, too. I can
ignore stupid opinion, but I hate to see BS presented as facts.
-- 
	bill davidsen		(wedu at ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.lang.c mailing list