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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7916caeb194e9cc2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-12 11:44:03 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!grolier!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!worldnet.att.net!24.0.0.38!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Problem with intertask comm References: <3ad5ecf3$0$191$456d72a3@news.skynet.be> X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 12 Apr 2001 18:38:17 GMT NNTP-Posting-Host: 24.20.190.201 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 987100697 24.20.190.201 (Thu, 12 Apr 2001 11:38:17 PDT) NNTP-Posting-Date: Thu, 12 Apr 2001 11:38:17 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:6832 Date: 2001-04-12T18:38:17+00:00 List-Id: >"The prefix to 'ACCESS shall not be statically deeper than that of the >expected type, Continuing" Consider: type Monitor_Data_Pointer is access all Monitor_Data; Saved_Away : Monitor_Data pointer; procedure p(param: in Monitor_Data_Pointer); ... declare monitor_data_a : aliased Monitor_Data; ... p(monitor_data_a'access); ... end; Saved_Away.all := Stuff; and suppose later procedure P(Param: in access Monitor_Data) is begin Saved_Away := Param; ... Stuff will be copied to Saved_Away.all, but Saved_Away.all is monitor_data_a, which, since we've left the declare block, no longer exists. This situation is possible because the prefix to 'access, namely monitor_data.all, is declared statically deeper than Saved_Away. Either monitor_data_a needs to be moved out of the declare block, to the same level as Saved_Away, or else "type Monitor_Data_Pointer is access all Monitor_Data;" needs to be moved down into the declare block, which forces Saved_Away to be in the declare block and thus safe.