Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!munnari.oz.au!mel.dit.csiro.au!yarra!melba.bby.oz.au!zvs From: zvs@bby.oz.au (Zev Sero) Newsgroups: comp.lang.c Subject: Re: Portability question for structures. Message-ID: <1991Jun20.225938.18098@melba.bby.oz.au> Date: 20 Jun 91 22:59:38 GMT References: <1991Jun19.194046.17317@axis.dsg.ti.com> Sender: usenet@melba.bby.oz.au (news READER id) Organization: Burdett, Buckeridge and Young Ltd. Lines: 21 In-Reply-To: olson@cuda.aaet.csc.ti.com's message of 19 Jun 91 19:40:46 GMT Nntp-Posting-Host: leo-gw 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@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.