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: 146b77,d275ffeffdf83655 X-Google-Attributes: gid146b77,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public X-Google-Thread: f5d71,d275ffeffdf83655 X-Google-Attributes: gidf5d71,public From: robert_dewar@my-dejanews.com Subject: Re: Ada vs C++ vs Java Date: 1999/01/18 Message-ID: <7803op$8ea$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 434085398 References: <369C1F31.AE5AF7EF@concentric.net> <369DDDC3.FDE09999@sea.ericsson.se> <369e309a.32671759@news.demon.co.uk> <369F0592.94F9DDDA@dresdner-bank.com> <77pnr4$ch3$1@newnews.global.net.uk> <36a3281a.11980677@news.demon.co.uk> <36A35D67.412F4820@dresdner-bank.com> <36a36bc1.29299700@news.demon.co.uk> X-Http-Proxy: 1.0 x10.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon Jan 18 19:58:22 1999 GMT Newsgroups: comp.lang.ada,comp.lang.c++,comp.vxworks,comp.lang.java X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-01-18T00:00:00+00:00 List-Id: In article <36a36bc1.29299700@news.demon.co.uk>, johnb@invision.co.uk wrote: > In a C compiler, addComplex would return a struct (as a > value) and take two structs as values. However they would > be passed by reference (by the compiler). No, not at all. C passes never passes anything by reference. You are using incorrect and confusing terminology. You meant to say that C works by passing a pointer to (a copy of) the value. But that is also wrong. There is nothing in the C standard that requires structures to be passed in this way, and on many, but not all, ABI's, small structures can be passed in registers. > But in C the calling function would create the > necessary stack space and pass addComplex a 'pointer' to > where it wanted the answer put. Usually using a register > specifically dedicated for such a purpose. Again, that is just plain wrong. No such register is used for example in the x86 calling sequence (there are just not enough registers). Really you are producing a LOT of misinformation in this thread. You should study compilers and ABI's in more detail. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own