From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Errornous String instantiation
Date: 21 Jul 2003 09:19:46 -0700
Date: 2003-07-21T16:19:46+00:00 [thread overview]
Message-ID: <1ec946d1.0307210819.16ae7153@posting.google.com> (raw)
In-Reply-To: slrnbhnguj.oa.lutz@taranis.iks-jena.de
Lutz Donnerhacke <lutz@iks-jena.de> wrote in message news:<slrnbhnguj.oa.lutz@taranis.iks-jena.de>...
Have you tried using the categorization pragmas?
> package Constants is
pragma Pure; --or else Preelaborate;
> t1 : aliased constant String := "Test";
> t2 : aliased constant String := "A longer test string";
> end Constants;
>
> package Top is
pragma Preelaborate;
> type Constant_String is access constant String;
> type Constant_String_Array is array(Positive range <>) of Constant_String;
> end Top;
>
> generic
> data : Constant_String_Array;
> package Top.Generic_Package is
> pragma Elaborate_Body;
> end Top.Generic_Package;
>
> with Ada.Text_IO;
> use Ada.Text_IO;
>
> package body Top.Generic_Package is
> begin
> for i in data'Range loop
> Put_Line("data (" & i'Img & " ) =" & data(i)'Length'Img);
> end loop;
> for i in data'Range loop
> Put_Line("data (" & i'Img & " ) =" & data(i)'Length'Img);
> end loop;
> end Top.Generic_Package;
>
> with Top.Generic_Package, Constants;
> use Constants;
pragma Elaborate_All (Top.Generic_Package);
pragma Elaborate_All (Contants);
>
> package MyPackage is new Top.Generic_Package((t1'Access, t2'Access));
> Did anybody came across this type of bug? Any idea how to solve the problem?
I don't know whether including the categorization pragmas will help
any, but it can't hurt.
Are you using GNAT? Did you try the -gnatwl switch?
-Matt
next prev parent reply other threads:[~2003-07-21 16:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-21 10:43 Errornous String instantiation Lutz Donnerhacke
2003-07-21 10:56 ` Preben Randhol
2003-07-21 11:02 ` Lutz Donnerhacke
2003-07-21 11:07 ` Preben Randhol
2003-07-21 12:35 ` Lutz Donnerhacke
2003-07-21 12:55 ` Lutz Donnerhacke
2003-07-21 21:54 ` Adrian Knoth
2003-07-21 11:08 ` Florian Weimer
2003-07-21 11:17 ` Preben Randhol
2003-07-21 16:19 ` Matthew Heaney [this message]
2003-07-21 16:26 ` Lutz Donnerhacke
2003-07-23 14:03 ` Lutz Donnerhacke
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox