Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!bionet!agate!ucbvax!CIM-VAX.HONEYWELL.COM!DERSTAD From: DERSTAD@CIM-VAX.HONEYWELL.COM Newsgroups: comp.sys.apollo Subject: Re: function prototype mystery Message-ID: <910412101246.2183@CIM-VAX.HONEYWELL.COM> Date: 12 Apr 91 15:12:46 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 31 > What do th &'s do to the first and third arguments The & turns the parameter into a reference variable. In essence, the parameter is passed by reference (address), but to both the caller and the callee it looks like a call by value. These are used extensively in the xxx_$ type calls since the underlying libraries are (or at least were) primarily written in Pascal, which tends to use pass by reference (esp. w/ Domain niceties like IN and OUT), but C code looks a bit silly with whatever_$call(&constant_parameter). It's a nice concept, since it allows pass by reference on large data structures without allowing the local procedure to modify the data structure BUT, as they say on TV "Don't try this at home" Despite the fact that this is fully documented (p. 5-13 of the A01 revision of the C manual) HP/Apollo does NOT fully support this construct. I ran into bugs in the & implementation (w.r.t. DDE) and got back an APR indicating that I was an ignorant fool for using this feature and why would anyone in their right mind want to use a non-portable construct? Further, the APR said "We'll *try* to maintain the interface as originally implemented" (emphasis added) which doesn't give me warm fuzzies about the future of all my code with &'s... At least this time it was always broken... not like the -nmgbl switch... Dave Erstad Honeywell SSEC DERSTAD@cim-vax.honeywell.com