Path: utzoo!attcan!uunet!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!sdd.hp.com!apollo!rehrauer From: rehrauer@apollo.HP.COM (Steve Rehrauer) Newsgroups: comp.sys.atari.st Subject: Re: cross-compiling Message-ID: <4dba9918.20b6d@apollo.HP.COM> Date: 31 Oct 90 15:49:00 GMT References: <1990Oct29.235921.23294@math.lsa.umich.edu> <4dba8b38.20b6d@apollo.HP.COM> Sender: root@apollo.HP.COM Reply-To: rehrauer@apollo.HP.COM (Steve Rehrauer) Organization: Hewlett-Packard Apollo Division - Chelmsford, MA Lines: 22 In article <4dba8b38.20b6d@apollo.HP.COM> rehrauer@apollo.HP.COM (I) wrote: >In article <1990Oct29.235921.23294@math.lsa.umich.edu> hyc@math.lsa.umich.edu (Howard Chu) writes: >>Of course, if you're only writing for 680x0 architectures, this won't ever >>be a problem (?) since data is aligned on word boundaries (2 bytes, 16 bits) >>and not longword boundaries (4 bytes, 32 bits). [but watch out for those >>single-byte declarations! }-) ] > >Well, not quite. I can't speak for other vendors, but Apollo C on our 68k >workstations can also insert padding between structure members to long-align >them. (A 32-bit fetch of a long-aligned object will run slightly faster >than a fetch of an odd-word-aligned object.) On a DN4500, for example, your >example struct would also be 32 bytes big. That'll teach me to post before the morning's caffeine takes effect. Forget what I said about Apollo C (it really will only word-align Howard's struct members). However, I don't see any reason why a compiler *mustn't* long- align struct members, can you? Aside from that it wastes space; I'm mean, in an idealogical sense. It sounds like something you shouldn't depend upon. -- "I feel lightheaded, Sam. I think my | (Steve) rehrauer@apollo.hp.com brain is out of air. But it's kind of | The Apollo Systems Division of a neat feeling..." -- Freelance Police | Hewlett-Packard