Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!bloom-beacon!oberon!bbn!uwmcsd1!ig!agate!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Structure alignment in Manx C Message-ID: <8802140413.AA17411@cory.Berkeley.EDU> Date: 14 Feb 88 04:13:11 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 22 >I just tracked down this bug that took me immense amounts of time >to find, and I discovered something about Manx C. I found out that >one of my friends had also run into and wasted hours finding this >anomaly. Specifically, Manx C does not long-word align structures >containing long words! (It also doesn't apparently long-word align >long words.) The ramifications of this are two-fold: It might not be preferable, but can hardly be called a bug. Remember that warning a lonnngg time ago about declaring such items as FileInfoBlocks auto? You can't for the very reason that they require longword alignment and since longwords don't, no assumption can be made as to the alignment the compiler used. The only solution is to AllocMem() the structure, or to use such generally unportable features as the +A link option in Aztec's linker (force a module to be aligned on a longword boundry). In the latter case, only a partial fix is obtained. There are assembly level constructs that allow you to align items however you wish but, of course, this requires inline assembly. -Matt