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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: How can one record component be local and another not? Date: Tue, 5 May 2020 13:04:53 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Jsulv2+8mOtAKlCYG0O/pweNACOrAw6EAr4ULkaA3kLTVvv7gH Cancel-Lock: sha1:Yyeii7EIRbt86NioM7UILfjCuJg= X-Mozilla-News-Host: news://News.Individual.DE:119 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Content-Language: de-DE Xref: reader01.eternal-september.org comp.lang.ada:58577 Date: 2020-05-05T13:04:53+02:00 List-Id: I have reduced my problem to the following example: package Aux is type Integer_P is access all Integer; type Rec is record a: aliased Integer; p: Integer_P; end record; procedure Init (r: in out Rec); end Aux; package body Aux is procedure Init (r: in out Rec) is begin r.p:= r.a'Access; -- <-- error! end Init; end Aux; Compiling results in "non-local pointer cannot point to local object" indicating the marked line above. How can one record component be local and another not? Intention is to have a library subprogram Init() for initialization. How would I implement that instead? (The reason for the above construction is the need to pass a pointer to a C library function.) -- Frank Hrebabetzky, Kronach +49 / 9261 / 950 0565