comp.lang.ada
 help / color / mirror / Atom feed
From: sangomarco@gmail.com
Subject: Re: Warning: accessibility check failure with GNAT GPL 2013
Date: Mon, 28 Oct 2013 08:23:40 -0700 (PDT)
Date: 2013-10-28T08:23:40-07:00	[thread overview]
Message-ID: <ab132196-0afd-4b06-8657-ccd0378aa951@googlegroups.com> (raw)
In-Reply-To: <tl10y112tmyq.2f1qzq62klj2.dlg@40tude.net>

Le lundi 28 octobre 2013 15:26:33 UTC+1, Dmitry A. Kazakov a écrit :
> On Mon, 28 Oct 2013 06:49:30 -0700 (PDT), sangomarco@gmail.com wrote:
> 
> 
> 
> >       function New_Thread return access Cyclic_Thread is
> 
> >       begin
> 
> >          return new Cyclic_Thread;
> 
> >       end New_Thread;
> 
> 
> 
> The rule of thumb: you never return an anonymous access result allocated by
> 
> new.
>

Thanks for your quick response. I don't have enough experience with Ada, please could you tell me more about the rule? I don't understand why this is not allow. My goal is to create a main task which makes a successor tasks if necessarry. And, since I cannot use the sybtype mak to create a new task in the current execution of a main task body as the following declaration
Next : access Cyclic_Thread;
next : new Cyclick_Thread;
I lazily use the previous function to return the access to the task.

--
Best regards
Marc




  reply	other threads:[~2013-10-28 15:23 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 [this message]
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
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