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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9d66743a9fdd96bd X-Google-Attributes: gid103376,public From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) Subject: Re: question about functions Date: 2000/01/20 Message-ID: <867eof$9ic1@news.cis.okstate.edu>#1/1 X-Deja-AN: 575388855 References: <867e3p$8ph$1@news.mgn.net> Organization: Oklahoma State University User-Agent: slrn/0.9.6.2 (Linux) Reply-To: dstarner98@aasaa.ofe.org Newsgroups: comp.lang.ada Date: 2000-01-20T00:00:00+00:00 List-Id: On Thu, 20 Jan 2000 17:44:52 +0100, Pascal LEJEUNE wrote: >Hello, > >I would like to know if there is a "clean" (i.e. not compiler dependant) >solution to this problem : No. There's not even a decent compiler dependent version. This is not an acceptable way to do whatever you were trying to do. What were you trying to do? >I explain : >if C := f(A, B); > >how can i know, in f, C's addres ? No. >function f(A, B : in T) return T is > ... >begin > ... > address of the result of f ? > ... >end f; The result is usually copied to a return value before being copied back. Probably by unchecked conversions between integers and pointers and the right knowledge of the stack, you could find the value. (This would be highly system and compiler specific, and is not recommended.) -- David Starner - dstarner98@aasaa.ofe.org If you wish to strive for peace of soul then believe; if you wish to be a devotee of truth, then inquire. -- Friedrich Nietzsche