Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site bunker.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!ittvax!bunker!garys From: garys@bunker.UUCP (Gary M. Samuelson) Newsgroups: net.lang.c Subject: Re: alignment on a VAX (structure member ordering) Message-ID: <769@bunker.UUCP> Date: Fri, 29-Mar-85 11:11:02 EST Article-I.D.: bunker.769 Posted: Fri Mar 29 11:11:02 1985 Date-Received: Sun, 31-Mar-85 03:16:27 EST References: <466@lll-crg.ARPA> <9339@brl-tgr.ARPA> <1159@reed.UUCP> <478@lll-crg.ARPA> Distribution: net Organization: Bunker Ramo, Trumbull Ct Lines: 17 > 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? Yes, you are mistaken. In K&R, appendix A, sec 8.5, p. 196: Within a structure, the objects declared have addresses which increase as their declarations are read left-to- right. Each non-field member of a structure begins on an addressing boundary appropriate to its type; therefore, there may be unnamed holes in a structure. Gary Samuelson ittvax!bunker!garys