Re: Layout of Structs

henry@zoo.toronto.edu
Wed, 31 May 89 05:10:50 EDT

          From comp.compilers

Related articles
Layout of Structs jac@paul.rutgers.edu (1989-05-28)
Re: Layout of Structs henry@zoo.toronto.edu (1989-05-31)
Re: Layout of Structs jac@paul.rutgers.edu (1989-06-02)
Re: Layout of Structs aglew@mcdurb.Urbana.Gould.COM (1989-06-04)
| List of all articles for this month |
From: henry@zoo.toronto.edu
Date: Wed, 31 May 89 05:10:50 EDT
Newsgroups: comp.compilers
In-Reply-To: <3992@ima.ima.isc.com>
References: <3979@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
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.