Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/28/84; site lll-crg.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!umcp-cs!gymble!lll-crg!brooks From: brooks@lll-crg.ARPA (Eugene D. Brooks III) Newsgroups: net.lang.c Subject: Re: Re: The importance of alignment on a VAX Message-ID: <478@lll-crg.ARPA> Date: Tue, 26-Mar-85 20:18:34 EST Article-I.D.: lll-crg.478 Posted: Tue Mar 26 20:18:34 1985 Date-Received: Fri, 29-Mar-85 01:18:42 EST References: <466@lll-crg.ARPA> <9339@brl-tgr.ARPA> <1159@reed.UUCP> Distribution: net Organization: Lawrence Livermore Labs, CRG group Lines: 21 > >the hardware will support it easily. It would be nice to read structures > >from other machines (like PDP-11's) sometime. > So C needs something like the Pascal keyword `packed'. (hee hee) A packed structure type would only give portability between a few machines. Although I would never want a machine with a 36 bit word they do exist and some of them have C compilers. The portability problem is best handled with a subroutine or macro to read the structure. Using a 'packed' structure introduces a speed penalty when the structure is used elsewhere and a hole host of other troubles just for the sake of giving limited I/O portability. I can't see any sense in this. This is against the philosophy of the language. The language has no I/O at all. Lets keep the I/O in routines where it belongs. If you want to read a structure from a pdp11 write a routine or a macro. It appears to me that packed structures are even jumping the gun. Does the C language even define the order in which the elements of a structure are placed in memory? The chapter on structures in K&R only states that the structure is a grouping of data items and I failed to find any statements about ordering of the elements. Am I mistaken about this?