From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,747be3e35071507b X-Google-Attributes: gid103376,public From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: Calling C function with structure parameter from ADA Date: 1995/04/19 Message-ID: <9511002.21349@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 101283230 sender: news@cs.mu.OZ.AU (CS-Usenet) references: <3lbu1o$n3p@theopolis.orl.mmc.com> organization: Computer Science, University of Melbourne, Australia newsgroups: comp.lang.ada Date: 1995-04-19T00:00:00+00:00 List-Id: kst@thomsoft.com (Keith Thompson) writes: >In 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