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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a369e9bb4bee1413,start X-Google-Attributes: gid103376,public From: bourguet@my-deja.com Subject: Are unconstrained arrays passed by references? Date: 1999/08/10 Message-ID: <7oomct$t93$1@nnrp1.deja.com>#1/1 X-Deja-AN: 510959620 X-Http-Proxy: NetCache@sj-netcache: Version DEMO_9T4, 1.0 x32.deja.com:80 (Squid/1.1.22) for client 158.140.3.201 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Tue Aug 10 08:03:45 1999 GMT X-MyDeja-Info: XMYDJUIDbourguet Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.05 [en] (X11; I; SunOS 5.5.1 sun4u) Date: 1999-08-10T00:00:00+00:00 List-Id: In the Intermetric X bindings, there is something like this in X.Strings (this is from memory, I may mess up the details but the principle should be clear): subtype char is Interfaces.C.char; type charp is access all char; function Addr (S : String) return charp; function To_X (A : System.Address) return charp is new Unchecked_Conversion... function Addr (S : String) return charp is begin return To_X (S (S'First)'Address); end Addr; There is a warning to use Addr only with variables and constants because if the argument was an expression the result may be dangling before it was of any use. I understand how this work if the string is passed by reference, and why passing unconstrained array by reference make sense, but as I've not found in the RM indications that it is mandatory I was wondering if I've missed something or if this code rely on a probable implementation. Thanks. -- Jean-Marc Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.