comp.lang.ada
 help / color / mirror / Atom feed
* GNAT Compilation Problems
@ 1996-09-20  0:00 Nigel J. Tracey
  1996-09-21  0:00 ` Robert Dewar
  1996-09-21  0:00 ` Robert Dewar
  0 siblings, 2 replies; 17+ messages in thread
From: Nigel J. Tracey @ 1996-09-20  0:00 UTC (permalink / raw)



I am having problems with compiling the below code using GNAT
3.05 on Linux 2.0.20 I have identified the line which causes
the problem but do not know why. With the program as it stands
I get a the following:

gcc: Internal compiler error: program gnat1 got fatal signal 11

Any help would be much appreciated. (Please also e-mail replies)

Thanks a lot,

	Nigel


--------------------
Nigel J. Tracey MEng, Research Associate (High Integrity Systems Group).
Department of Computer Science,   Office: X/D016
University of York,               Tel   : [0|+44]1904 432769
York, England.                    E-Mail: njt@minster.york.ac.uk
YO1 5DD.                          URL   : http://sv1pc161.cs.york.ac.uk/~njt



with Lists;
with String_Pkg;
with TEXT_IO; use TEXT_IO;

procedure variant is


   type Basic_Type is (NONE, ENUM, INT, BOOL, FLOAT_NUM, FIXED_NUM, CHAR);

   type Type_Information_Type(Base_Type : Basic_Type := NONE) is
      record
         Type_Name : String_Pkg.String_Type;
         case Base_Type is
            when INT | CHAR | ENUM =>
               Min_Integer : Integer;
               Max_Integer : Integer;
            when BOOL =>
               null;
            when FLOAT_NUM =>
               Float_Precision : Integer;
               Min_Float : Float;
               Max_Float : Float;
            when FIXED_NUM =>
               Fixed_Precision : Float;
               Min_Fixed : Float;
               Max_Fixed : Float;
            when NONE =>
               null;
         end case;
      end record;

   package Type_List is new
      Lists(Type_Information_Type);

   TypeLst : Type_List.List;

   Standard_Ada_Types : constant array(1..4) of Type_Information_Type :=
      ((INT, String_pkg.Create("Integer"), -2147483647, 2147483647),
       (BOOL, String_pkg.Create("Boolean")),
       (FLOAT_NUM, String_pkg.Create("Float"), 6, -3.40282E+38, 3.40282E+38),
       (INT, String_pkg.Create("Character"), 0, 255));

   procedure Add_Subtype
     (Type_Name : String_Pkg.String_Type;
      Subtype_Name : String_Pkg.String_Type)
   is

      List_Iterator : Type_List.ListIter;
      Temp : Type_Information_Type;

   begin

      List_Iterator := Type_List.MakeListIter(TypeLst);

      while Type_List.More(List_Iterator)
      loop
         Type_List.Next(List_Iterator, Temp);
         if String_Pkg.Equal(Temp.Type_Name, Subtype_Name) then
            Temp.Type_Name := Type_Name;
            Type_List.Attach(TypeLst, Temp);
            return;
         end if;
      end loop;

   end Add_Subtype;

	
begin
   TypeLst := Type_List.Create;
   for Counter in Standard_Ada_Types'Range
   loop
      Type_List.Attach(TypeLst, Standard_Ada_Types(Counter));
   end loop;
end Variant;




^ permalink raw reply	[flat|nested] 17+ messages in thread
* GNAT Compilation Problems
@ 1996-09-20  0:00 Nigel J. Tracey
  1996-09-21  0:00 ` David C. Hoos, Sr.
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Nigel J. Tracey @ 1996-09-20  0:00 UTC (permalink / raw)



I am having problems with compiling the below code using GNAT
3.05 on Linux 2.0.20 I have identified the line which causes
the problem but do not know why. With the program as it stands
I get a the following:

gcc: Internal compiler error: program gnat1 got fatal signal 11

The line which seems to cause the problem is higlighed below
as -- *****************
With this line commented out, things seem to compile fine.
This line is however vitial!!! :)

Any help would be much appreciated. (Please also e-mail replies)

Thanks a lot,

	Nigel


--------------------
Nigel J. Tracey MEng, Research Associate (High Integrity Systems Group).
Department of Computer Science,   Office: X/D016
University of York,               Tel   : [0|+44]1904 432769
York, England.                    E-Mail: njt@minster.york.ac.uk
YO1 5DD.                          URL   : http://sv1pc161.cs.york.ac.uk/~njt



with Lists;
with String_Pkg;
with TEXT_IO; use TEXT_IO;

procedure variant is


   type Basic_Type is (NONE, ENUM, INT, BOOL, FLOAT_NUM, FIXED_NUM, CHAR);

   type Type_Information_Type(Base_Type : Basic_Type := NONE) is
      record
         Type_Name : String_Pkg.String_Type;
         case Base_Type is
            when INT | CHAR | ENUM =>
               Min_Integer : Integer;
               Max_Integer : Integer;
            when BOOL =>
               null;
            when FLOAT_NUM =>
               Float_Precision : Integer;
               Min_Float : Float;
               Max_Float : Float;
            when FIXED_NUM =>
               Fixed_Precision : Float;
               Min_Fixed : Float;
               Max_Fixed : Float;
            when NONE =>
               null;
         end case;
      end record;

   package Type_List is new
      Lists(Type_Information_Type);

   TypeLst : Type_List.List;

   Standard_Ada_Types : constant array(1..4) of Type_Information_Type :=
      ((INT, String_pkg.Create("Integer"), -2147483647, 2147483647),
       (BOOL, String_pkg.Create("Boolean")),
       (FLOAT_NUM, String_pkg.Create("Float"), 6, -3.40282E+38, 3.40282E+38),
       (INT, String_pkg.Create("Character"), 0, 255));

   procedure Add_Subtype
     (Type_Name : String_Pkg.String_Type;
      Subtype_Name : String_Pkg.String_Type)
   is

      List_Iterator : Type_List.ListIter;
      Temp : Type_Information_Type;

   begin

      List_Iterator := Type_List.MakeListIter(TypeLst);

      while Type_List.More(List_Iterator)
      loop
      	-- ************************
      	-- The line below causes the problems
      	-- ************************
         Type_List.Next(List_Iterator, Temp);

         if String_Pkg.Equal(Temp.Type_Name, Subtype_Name) then
            Temp.Type_Name := Type_Name;
            Type_List.Attach(TypeLst, Temp);
            return;
         end if;
      end loop;

   end Add_Subtype;

	
begin
   TypeLst := Type_List.Create;
   for Counter in Standard_Ada_Types'Range
   loop
      Type_List.Attach(TypeLst, Standard_Ada_Types(Counter));
   end loop;
end Variant;




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

end of thread, other threads:[~1996-10-11  0:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-20  0:00 GNAT Compilation Problems Nigel J. Tracey
1996-09-21  0:00 ` Robert Dewar
1996-09-21  0:00 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-09-20  0:00 Nigel J. Tracey
1996-09-21  0:00 ` David C. Hoos, Sr.
1996-09-21  0:00   ` Graffiti
1996-09-21  0:00   ` Graffiti
1996-09-22  0:00     ` Keith Thompson
1996-09-21  0:00 ` David C. Hoos, Sr.
1996-10-02  0:00   ` Kevin English
1996-10-08  0:00     ` Robert Dewar
1996-10-08  0:00       ` Gandalf
1996-10-09  0:00         ` Robert Dewar
1996-10-11  0:00           ` Michael Feldman
1996-09-23  0:00 ` Simon Wright
1996-10-11  0:00 ` Michel Gauthier
1996-10-11  0:00   ` Robert Dewar

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