From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed23aab45a548fd6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-21 09:19:47 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Errornous String instantiation Date: 21 Jul 2003 09:19:46 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0307210819.16ae7153@posting.google.com> References: NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1058804386 29079 127.0.0.1 (21 Jul 2003 16:19:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 21 Jul 2003 16:19:46 GMT Xref: archiver1.google.com comp.lang.ada:40565 Date: 2003-07-21T16:19:46+00:00 List-Id: Lutz Donnerhacke wrote in message news:... 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