Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!lll-tis!oodis01!uplherc!sp7040!obie!wes From: wes@obie.UUCP (Barnacle Wes) Newsgroups: comp.lang.c Subject: Re: Optimal structure field ordering Summary: Let the compiler choose the structure ordering? Not my compiler, PLEASE! Message-ID: <254@obie.UUCP> Date: 28 Jun 88 01:00:31 GMT References: <163@navtech.uucp> <806@garth.UUCP> Organization: Great Salt Lake Yacht Club, north branch Lines: 17 In article <806@garth.UUCP>, smryan@garth.UUCP (Steven Ryan) writes: > (Not being a C expert, I don't know if this true.) A nice language > definition will say you can define fields but doesn't say what order > they are allocated. It would be better if the compiler can sort the > fields to optimise access and balance space/time. In this way you > can write the structures as it makes sense and not worry about > dinking it for a particular machine. A little further though might show this idea to have some far-reaching bad karma. It would be very difficult to write a file system portable across machines of varying architecture (i.e. Idris) if the compiler on each machine can arbitrarily re-arrange structures to suit its own whim. This might start another `volatile' war :-) but it ain't good for those who use C for what it was intended - systems programming :-). -- {uwmcsd1, hpda}!sp7040!obie!wes | "If I could just be sick, I'd be fine." +1 801 825 3468 | -- Joe Housely --