Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!tut.cis.ohio-state.edu!unmvax!ncar!husc6!spdcc!ima!compilers-sender From: henry@zoo.toronto.edu Newsgroups: comp.compilers Subject: Re: Layout of Structs Message-ID: <4002@ima.ima.isc.com> Date: 31 May 89 09:10:50 GMT References: <3979@ima.ima.isc.com> Sender: compilers-sender@ima.ima.isc.com Reply-To: henry@zoo.toronto.edu Lines: 21 Approved: compilers@ima.UUCP In-Reply-To: <3992@ima.ima.isc.com> >It is a Good Thing [tm] that structures are laid out in this way. As >a hardware type, I often need to write device drivers. Being able to >impose a structure onto a hardware memory map is a very useful thing, >indeed. Beware, however, that it is still possible for C structures to have unnamed holes in them more or less wherever the compiler pleases. C does *not* give you complete control of storage layout, and never has, although in many compilers you can do pretty much what you want at the price of having your code depend on assumptions about the compiler. Case in point: on a 68020, are longs 16-bit aligned or 32-bit aligned? Compilers differ. Henry Spencer at U of Toronto Zoology uunet!attcan!utzoo!henry henry@zoo.toronto.edu -- Send compilers articles to compilers@ima.isc.com or, perhaps, Levine@YALE.EDU Plausible paths are { decvax | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request