comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Problem with intertask comm
Date: Thu, 12 Apr 2001 18:38:17 GMT
Date: 2001-04-12T18:38:17+00:00	[thread overview]
Message-ID: <tCmB6.11960$ix4.9240840@news1.rdc1.sfba.home.com> (raw)
In-Reply-To: 3ad5ecf3$0$191$456d72a3@news.skynet.be

>"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.



  reply	other threads:[~2001-04-12 18:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-12 17:58 Problem with intertask comm Tom De Muer
2001-04-12 18:38 ` tmoran [this message]
2001-04-12 21:38 ` Ted Dennison
2001-04-12 22:06   ` Tom De Muer
2001-04-12 23:41     ` tmoran
2001-04-13 13:28     ` Ted Dennison
2001-04-13 17:10       ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox