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,bbbeae4ed07e9626 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Address to function pointer conversion Date: 1997/06/14 Message-ID: #1/1 X-Deja-AN: 248484207 References: <5nrq5h$13cm@info4.rus.uni-stuttgart.de> <33A1831C.269F@sprintmail.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-06-14T00:00:00+00:00 List-Id: John says ~ <> ~ ~ ~ If the address is coming from C, then I think the following should be quite portable: ~ type x is access procedure .... pragma Convention (C, X); ~ function Get_Address return x; pragma Import (C, Get_Address); Now your compiler might reject the pragma Convention on X, but it is reasonable that it shouold be supported, and if it is supported, then it should work. Notice this general approach, instead of importing some foreign gizmo from C like an address, import it in properly typed form, but apply pragma Convention C to the type. This is generally what should be done for access types as well when communicating with C.