Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/28/84; site lll-crg.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!umcp-cs!gymble!lll-crg!brooks From: brooks@lll-crg.ARPA (Eugene D. Brooks III) Newsgroups: net.lang.c Subject: Re: Re: Un-alignment in structures Message-ID: <484@lll-crg.ARPA> Date: Mon, 1-Apr-85 02:16:19 EST Article-I.D.: lll-crg.484 Posted: Mon Apr 1 02:16:19 1985 Date-Received: Wed, 3-Apr-85 00:45:33 EST References: <230@tellab2.UUCP> <135@mit-athena.UUCP> Organization: Lawrence Livermore Labs, CRG group Lines: 12 I find the argument for having packet structures to save memory reasonable. This is a genuine concern in many codes. An example of this would be a simulation code for a packet switching system where the packets have many fields of different types. When I write such codes I find myself carefully ordering the structure declarations to minimize the effects of padding. Would lifting the restriction on the addressing order of structure elements fill this need without any changes to the sematics of C? Suppose the compiler were free to reorder the elements of a structure in order to minimize padding. Would it break any code? Are there programs (other than I/O portability) that depend on structure elements being ordered in memory with the same order as the delcarations?