Path: utzoo!attcan!uunet!husc6!bbn!rochester!cornell!batcomputer!itsgw!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: Portability and alignment constraints Message-ID: <10939@steinmetz.ge.com> Date: 23 May 88 15:37:22 GMT References: <2853@pasteur.Berkeley.Edu> <51436@sun.uucp> <524@wsccs.UUCP> <10886@steinmetz.ge.com> <11567@mimsy.UUCP> Reply-To: davidsen@kbsvax.steinmetz.UUCP (William E. Davidsen Jr) Organization: General Electric CRD, Schenectady, NY Lines: 43 In article <11567@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >In article <10886@steinmetz.ge.com> davidsen@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@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@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me