comp.lang.ada
 help / color / mirror / Atom feed
* Warning: accessibility check failure with GNAT GPL 2013
@ 2013-10-28 13:49 sangomarco
  2013-10-28 14:26 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 8+ messages in thread
From: sangomarco @ 2013-10-28 13:49 UTC (permalink / 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;


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-31  1:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-10-31  1:28       ` Randy Brukardt

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