comp.lang.ada
 help / color / mirror / Atom feed
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Calling C function with structure parameter from ADA
Date: 1995/04/19
Date: 1995-04-19T00:00:00+00:00	[thread overview]
Message-ID: <9511002.21349@mulga.cs.mu.OZ.AU> (raw)
In-Reply-To: D6pwGs.8wE@thomsoft.com

kst@thomsoft.com (Keith Thompson) writes:

>In <dewar.797190489@gnat> dewar@cs.nyu.edu (Robert Dewar) writes:
>> T.E.D. assumes that C passes structures by address. This is wrong, it varies
>> from one machine environment to another.
>
>It shouldn't.  The C standard specifies that all parameters, including
>structures, are passed by copy, though of course you can explicitly
>pass an address.

The C standard just specifies that the semantics must be as if they
were passed by copy.  Implementations can and often do pass addresses
but still maintain call-by-value semantics, e.g. by having the caller
make a copy (if necessary) and then passing its address.

-- 
Fergus Henderson            | As practiced by computer science, the study of
fjh@cs.mu.oz.au             | programming is an unholy mixture of mathematics,
http://www.cs.mu.oz.au/~fjh | literary criticism, and folklore. - B. A. Sheil




      parent reply	other threads:[~1995-04-19  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-28 17:22 Calling C function with structure parameter from ADA C.G. Williams
1995-03-29  0:00 ` Theodore Dennison
1995-04-06  0:00   ` Robert Dewar
1995-04-07  0:00     ` Chris Warack <sys mgr>
1995-04-07  0:00       ` Robert Dewar
     [not found]     ` <D6pwGs.8wE@thomsoft.com>
1995-04-19  0:00       ` Fergus Henderson [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox