[comp.sys.apollo] function prototype mystery

DERSTAD@CIM-VAX.HONEYWELL.COM (04/12/91)

>  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

DERSTAD@CIM-VAX.HONEYWELL.COM (04/13/91)

>  I only have the A00 manuals, which is why I couldn't find it there

In A00, it's on p. 5-11.  It took us (jt and I) quite a while to find
it the first time too.  None of the index entries help unless you 
already know what it's called...  Funny how that works.

Dave Erstad
Honeywell SSEC
DERSTAD@cim-vax.honeywell.com

etb@milton.u.washington.edu (Eric Bushnell) (04/15/91)

My thanks to everyone who responded to this query.

Yes, it *is* in the manual, but, IMHO, it's treated rather
casually for a something that *must* be used correctly with
even simple system calls.


Eric Bushnell
Univ of Washington Civil Engineering
etb@u.washington.edu
-- 
Eric Bushnell
Univ of Washington Civil Engineering
etb@u.washington.edu