comp.lang.ada
 help / color / mirror / Atom feed
From: sangomarco@gmail.com
Subject: Warning: accessibility check failure with GNAT GPL 2013
Date: Mon, 28 Oct 2013 06:49:30 -0700 (PDT)
Date: 2013-10-28T06:49:30-07:00	[thread overview]
Message-ID: <4395468b-93d3-45f4-8bc0-91cd646ff1d9@googlegroups.com> (raw)

Hi,

I have the accessibility check failure with GNAT GPL version 2013. When I try to instantiate a task type in a task body (warning line -- Next := New_Thread; -- see my code below), I have the following warning : accessibility check failure, program_Error will be raised at runtime.
However, I don't have any warning when I compile with  the last version GNAT GPL 2012. 

What it's the problem and how I can resolve this.
Thanks in adavance for your help.

Below is my code :

-----------------
with Threads;
Procedure Main is
   package Tasks_Inst is new Threads (Integer,1);
   use Tasks_Inst;
begin
   Tasks_Inst.Run_Threads(3);
end Main;

-----------------
generic
   type Element is private;
   Unit: in Element;
Package Threads is
   procedure Run_Threads (Test_Element : in Element);
end Threads;

-----------------
package body Threads is

   Procedure Run_Threads (Test_Element : in Element) is

      task type Cyclic_Thread;

      function New_Thread return access Cyclic_Thread is
      begin
         return new Cyclic_Thread;
      end New_Thread;

      task body Cyclic_Thread is
         Next : access Cyclic_Thread;
      begin
	 if Next = null then
	    Next := New_Thread; ------ warning line
	 end if;
      end Cyclic_Thread;

      First : access Cyclic_Thread;
      E : Element := unit;
   begin
      First := New Cyclic_Thread;
   end Run_Threads;

end Threads;


             reply	other threads:[~2013-10-28 13:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 13:49 sangomarco [this message]
2013-10-28 14:26 ` Warning: accessibility check failure with GNAT GPL 2013 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
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