Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxr!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!ron From: ron@brl-tgr.ARPA (Ron Natalie ) Newsgroups: net.lang.c Subject: Re: Un-alignment in structures Message-ID: <9251@brl-tgr.ARPA> Date: Fri, 15-Mar-85 14:37:29 EST Article-I.D.: brl-tgr.9251 Posted: Fri Mar 15 14:37:29 1985 Date-Received: Sun, 17-Mar-85 00:26:51 EST References: <9239@brl-tgr.ARPA> Organization: Ballistic Research Lab Lines: 20 > > the reason for the padding, which admittedly does not hold for > some machines, is that many machines, notably the pdp-11, can not > handle words generated at an odd address. if the compiler was allowed > to generate incorrectly aligned data then the compiler would rapidly > acquire, and rightfully so, a reputation for uselessness; the code > produced would generate odd instruction traps at the most inconvenient > locations. > Understandable, but with loss of effieciency you ought to be able to at least assign in and out of "unaligned" data. I know that taking the address of something that is aligned incompatibly with the machine (like odd ints on pdp-11s) and thn passing it as a pointer is going to cause problems. 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