Newsgroups: news.software.b Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Cnews on System V/AT: "expression causes compiler loop" Message-ID: <1989Nov24.164158.29747@utzoo.uucp> Organization: U of Toronto Zoology References: <3056@splut.conmicro.com> <1989Nov20.181839.1546@utzoo.uucp> <1676@crdos1.crd.ge.COM> <1063@east.East.Sun.COM> <1989Nov21.17513 <480@mwtech.UUCP> Date: Fri, 24 Nov 89 16:41:58 GMT In article <480@mwtech.UUCP> martin@mwtech.UUCP (Martin Weitzel) writes: >Did you ever think about the following alternative to offsetof(): >2) When 'make'ing the programm, *automatically* generate an > #include-file with the required #defines by > 2a) compile and run a programm, which calculates > the offset by taking the difference of the > struct.component-s adress and the struct-s adress... Can't say we'd thought about it, but it boils down to doing the same thing a step at a time in a separate program rather than all at once in the main program. I'm not sure that it really gains us much, except reducing the complexity of the expressions the compiler is asked to handle... and we made an explicit decision very early on that it was hopeless to try to cater to all the defective compilers in the world. If it gained us something on portability or something like that, that might be sufficient added motive to do it. As it is, it just looks like extra complexity for the sake of one or two broken compilers. Sorry. -- That's not a joke, that's | Henry Spencer at U of Toronto Zoology NASA. -Nick Szabo | uunet!attcan!utzoo!henry henry@zoo.toronto.edu