comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@aol.com>
Subject: Re: Warning: accessibility check failure with GNAT GPL 2013
Date: Mon, 28 Oct 2013 10:31:09 -0700 (PDT)
Date: 2013-10-28T10:31:09-07:00	[thread overview]
Message-ID: <617b0482-3cb4-4ea5-9600-5dafe982d15f@googlegroups.com> (raw)
In-Reply-To: <526e8d35$0$9522$9b4e6d93@newsspool1.arcor-online.net>

On Monday, October 28, 2013 9:13:41 AM UTC-7, Georg Bauhaus wrote:
> On 28.10.13 16:49, Dmitry A. Kazakov wrote:
> 
> > Use a named access type instead. E.g.
> 
> >    type Cyclic_Thread_Ptr is access all Cyclic_Thread:
 
> 2nd. And consider dropping "all" from the above type
> declaration, if possible. In your example, all pointers
> point to tasks of type Cyclic_Thread that were created
> by an allocator, so "all" is not needed. (Because you
> do not store the 'Access of some "non-heap" task object
> in some pointer variable.)

Although the example may not use any objects that aren't created by an allocator, the question is whether there's any possibility that a programmer *might* want to use the access type to refer to aliased variables or other non-allocated objects later.  If we know that, by the *nature* of the access type and what it's supposed to represent, that having it refer to aliased variables would be unacceptable or cause problems, then don't include "all".  But otherwise I think it's best to include "all".  I include "all" routinely since I haven't written an access type definition where I thought that those access objects *must* refer to heap-allocated objects in all cases.  (If Ada 95 had been designed from scratch, it would have been better to provide an additional keyword to designate access types that must be heap-allocated, if a distinction had to be made at all.  But they were considering the possibility that a pool-specific access type would be represented as a pool-relative offset rather than as an address, and that there could be Ada 83 compilers already doing that.)

                                -- Adam


  reply	other threads:[~2013-10-28 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 13:49 Warning: accessibility check failure with GNAT GPL 2013 sangomarco
2013-10-28 14:26 ` Dmitry A. Kazakov
2013-10-28 15:23   ` sangomarco
2013-10-28 15:49     ` Dmitry A. Kazakov
2013-10-28 16:05       ` sangomarco
2013-10-28 16:13       ` Georg Bauhaus
2013-10-28 17:31         ` Adam Beneschan [this message]
2013-10-31  1:28       ` Randy Brukardt
replies disabled

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