Portability question for structures.

Zev Sero zvs at bby.oz.au
Fri Jun 21 08:59:38 AEST 1991


DO> What I need to know is, how portable are the list processing
DO> functions.  They are based on the assumption that the first three
DO> fields of the list structures will be void *, void * and char *.
DO> Is this a valid assumption? or can the order that fields are
DO> listed in a structure be changed by the compiler?


  `C compilers are constrained to assign components increasing memory
  addresses in a strict order, with the first component starting at
  the beginning address of the structure itself.'

			- H&S2 page 104

So the answer is, yes, they are portable (assuming that you have
provided for the holes in the struct).
--
				Zev Sero  -  zvs at bby.oz.au
`This constant intervention by government in tasks that belong to the
individual must cease, or ours will become as bureaucratic a government
as that of Russia.'   - Senator Thomas Bayard, speaking on an animal
			inspection bill, 28 Apr 1884. 



More information about the Comp.lang.c mailing list