Path: utzoo!attcan!uunet!mcvax!enea!kth!draken!liuida!pausv From: pausv@teorix.liu.se (Paul Svensson) Newsgroups: comp.lang.c Subject: Re: Addresses of parameters Message-ID: <1013@teorix.liu.se> Date: 30 Oct 88 14:46:33 GMT References: <35620@XAIT.Xerox.COM> <10124@haddock.ima.isc.com> <35664@XAIT.Xerox.COM> <29781@think.UUCP> Organization: CIS Dept, Univ of Linkoping, Sweden Lines: 24 Disclaimer: What is an opinion, anyway? In article <29781@think.UUCP> barmar@kulla.think.com.UUCP (Barry Margolin) writes: >In article <35664@XAIT.Xerox.COM> g-rh@XAIT.Xerox.COM (Richard Harter) writes: >>taking the address of a parameter is not a useful kind of thing to do. > [edited] >the address of that. I think taking the address of the parameter is >preferable to making ANOTHER copy of the structure (the first copy has >to be made during the calling sequence of the function). > The OBVIOUS solution is of course to pass the structure by address in the first place, if you're so afraid of copying it. Yes, I agree with Barry that taking tha address of a parameter is not very useful, but that is NOT a good reason for not allowing it. There are other good reasons, such as making it easier to pass arguments in registers, for example. On some machines, like the pdp-10, taking the address of a register (or a bitfield, but i digress) is easy, on others its just plain IMPOSSIBLE. To allow "&" to work on parameters is essentially the same as to allow it to work on register variables, it requires the same kind if "fixes" to the compiler. (Unless parameters are always passed on the stack, an arcane and resource-wasting policy.) /Paul