Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!carroll From: carroll@m.cs.uiuc.edu Newsgroups: comp.lang.c Subject: Re: RISC Machine Data Structure Word Al Message-ID: <4700048@m.cs.uiuc.edu> Date: 24 Feb 90 10:39:38 GMT References: <111@melpar.UUCP> Lines: 30 Nf-ID: #R:melpar.UUCP:111:m.cs.uiuc.edu:4700048:000:1569 Nf-From: m.cs.uiuc.edu!carroll Feb 23 09:46:00 1990 >/* Written 11:34 am Jan 29, 1990 by henry@utzoo.uucp in m.cs.uiuc.edu:comp.lang.c */ >In article <51385@bbn.COM> jgrace@BBN.COM (Joe Grace) writes: >>... I think the language, C (and C++), is to blame (and >>would prefer C and C++ to pack struct members as suggested by >>the programmer's struct definition). > >The basic problem here is that the compiler cannot read minds, and the >language does not provide a way to tell the compiler which of two >interpretations is wanted. >-- >1972: Saturn V #15 flight-ready| Henry Spencer at U of Toronto Zoology >1990: birds nesting in engines | uunet!attcan!utzoo!henry henry@zoo.toronto.edu >/* End of text from m.cs.uiuc.edu:comp.lang.c */ Wouldn't this be a place for a #pragma extension? I.e., the default behaviour is to layout the structure in textual order as is done now, while a #pragma PACK_STRUCTURES would tell the compiler that the program doesn't depend on the ordering of the structure members, and the compiler is free to rearrange them in order to produce the minimum memory size based on alignment restrictions. This way compilers without the pragma would still run the code, but pay the memory cost. Alan M. Carroll "Like the north wind whistling down the sky, carroll@cs.uiuc.edu I've got a song, I've got a song. Conversation Builder: I carry it with me and I sing it loud + Tomorrow's Tools Today + If it gets me nowhere, I'll go there proud" Epoch Development Team CS Grad / U of Ill @ Urbana ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll