Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Addresses of parameters (was Re: Portability of passing/operating ...) Message-ID: <1988Oct27.162815.1222@utzoo.uucp> Organization: U of Toronto Zoology References: <8810111934.AA21941@ucbarpa.Berkeley.EDU> <8308@alice.UUCP> <23933@wlbr.EATON.COM> <1988Oct19.192548.28438@ateng.ateng.com> <35 <35569@XAIT.Xerox.COM> <41337@yale-celray.yale.UUCP> <35620@XAIT.Xerox.COM> Date: Thu, 27 Oct 88 16:28:15 GMT In article <35620@XAIT.Xerox.COM> g-rh@XAIT.Xerox.COM (Richard Harter) writes: >... The technical reason is that a calling sequence >parameter need not have an address... >... Arguments in C are copies of the parameters passed. The address >(if it exists) is the address of the copy; it is not, so to speak, an >address of a real object. The general point is that calling sequence >parameters are a different breed of cat from other variables... Sorry, not so. C parameters are defined, and have been defined for a long time, to be local variables that are initialized to the values supplied by the caller. They are specifically *not* a different breed of cat from other local variables. They are real objects; if the & operator is used on one (legally, i.e. in the absence of "register"), the parameter must have an address. This admittedly makes extra work for implementations that normally pass parameters in registers, but that's part of the job. A compiler that botches this is broken. -- The dream *IS* alive... | Henry Spencer at U of Toronto Zoology but not at NASA. |uunet!attcan!utzoo!henry henry@zoo.toronto.edu