comp.lang.ada
 help / color / mirror / Atom feed
From: Charly <carl.weierstrass@googlemail.com>
Subject: strange error in tiny ada 2012 program
Date: Fri, 6 Jul 2012 14:55:53 -0700 (PDT)
Date: 2012-07-06T14:55:53-07:00	[thread overview]
Message-ID: <ba3d13c3-527e-4f09-8d09-ee7d450e5b62@googlegroups.com> (raw)

Hi all

I installed the new GNAT GPL 2012 and started playing with the new Synchronized_Queue Containers.
Unfortunately I got serverall problems, which can be shown in the following tiny test program


 1  with Ada.Containers.Synchronized_Queue_Interfaces;
 2  with Ada.Containers.Bounded_Synchronized_Queues;
 3  with Ada.Text_IO;
 4  
 5  procedure Ctest is
 6  
 7  
 8     package Integer_Queue_Interfaces is
 9           new Ada.Containers.Synchronized_Queue_Interfaces (Integer);
10  
11     package Integer_Queues is
12       new Ada.Containers.Bounded_Synchronized_Queues (Integer_Queue_Interfaces, 10);
13  
14     subtype Integer_Queue_Type is Integer_Queues.Queue;
15  
16     -- type New_Integer_Queue_Type is new Integer_Queue_Type with null record;
17  
18     type Integer_Queue_Record is tagged limited record
19        Queue : Integer_Queue_Type;
20     end record;
21  
22     --Integer_Queue1 : Integer_Queue_Type;
23     Integer_Queue2 : Integer_Queue_Record;
24  
25  begin
26  
27     Ada.Text_IO.Put_Line ("Hello Ada");
28  
29  end Ctest;


First problem occured in line 16 where I want to extend the Integer_Queue_Type
but I got an error message:

ctest.adb:16:04: parent type of a record extension cannot be a synchronized tagged type (RM 3.9.1 (3/1))

So I removed the statement and defined a new tagged type with the Integer_Queue_Type as record element
in lines 18 - 20. This variant compiles without messages but now I get an exception STORAGE_ERROR.
addr2line locates the error in line 5 what isn't very usefull. By trial and error I found, that the
error comes from line 23, when I replace it with line 22 the program 'works'.

So my questions are:
Did I make any mistake in this tiny program or is it a bug in the new GNAT version?
How can a extend a proteced type (line 16).


Thanks



             reply	other threads:[~2012-07-06 21:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 21:55 Charly [this message]
2012-07-07  0:36 ` strange error in tiny ada 2012 program Adam Beneschan
2012-07-07 10:25 ` Georg Bauhaus
replies disabled

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