Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rtech.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!amdahl!rtech!jeff From: jeff@rtech.ARPA (Jeff Lichtman) Newsgroups: net.lang.c Subject: Re: Un-alignment in structures Message-ID: <248@rtech.ARPA> Date: Thu, 21-Mar-85 21:10:55 EST Article-I.D.: rtech.248 Posted: Thu Mar 21 21:10:55 1985 Date-Received: Mon, 25-Mar-85 02:42:44 EST References: <9239@brl-tgr.ARPA> <9251@brl-tgr.ARPA> Organization: Relational Technology, Berkeley CA Lines: 20 > > What really galls me is that the VAX, which has virtually no alignment > restrictions, insists on padding out structures where the exact same > declaration on the PDP-11 doesn't. > > -Ron This isn't true on VMS. When we converted our software from Whitesmith's to DEC C, we found that the former aligns structures and the latter doesn't. This caused us problems because we store structures in files, so we had to add our own padding. Sometimes it is a good idea to align structures on machines that don't require it because it makes the code run faster. Reading or writing an aligned word takes only one memory cycle, as opposed to two for an unaligned word. I agree that the compiler shouldn't pad for you, because this takes away the choice. -- Jeff Lichtman at rtech (Relational Technology, Inc.) aka Swazoo Koolak