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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,be90c35154ae91c1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-04 09:25:43 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: thomas_haeckel@web.de (Thomas Haeckel) Newsgroups: comp.lang.ada Subject: error in index constraints with initial value Date: 4 Apr 2002 09:25:42 -0800 Organization: http://groups.google.com/ Message-ID: <21b0043b.0204040925.4654c421@posting.google.com> NNTP-Posting-Host: 195.243.118.226 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1017941142 4031 127.0.0.1 (4 Apr 2002 17:25:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 4 Apr 2002 17:25:42 GMT Xref: archiver1.google.com comp.lang.ada:22109 Date: 2002-04-04T17:25:42+00:00 List-Id: Hi, I've compiled the following procedure with gnat version 2.8.1 and also 3.14p. 1:with Text_IO; use Text_IO; 2: 3:procedure Index_Constraint_Test is 4: 5:type VAR_LINE(LENGTH:INTEGER:=5) is 6:record 7: IMM:STRING(1..LENGTH); 8:end record; 9: 10:NULL_LINE: VAR_LINE(0); 11:TWO_LINE: VAR_LINE(2); 12:XXXX_LINE: VAR_LINE; 13: 14:begin 15: Put_Line("NULL_LINE="&NULL_LINE.IMM&"#"); 16: Put_Line("TWO_LINE="&TWO_LINE.IMM&"#"); 17: Put_Line("XXXX_LINE="&XXXX_LINE.IMM&"#"); 18:end; I got following runtime error with both gnat versions: raised STORAGE_ERROR : object too large This is caused by the variable instantiation XXXX_LINE in line 12. After the example in LRM 3.6.1(15) this should be allowed. Also an old Aionix-Ada83-compiler works fine. Why has the initialization of the index constraint in line 5 no effect apparently ? Is this effect a "feature" of gnat or Ada95 ? How can I do an null-array (length 0, no component) definition at compile time, to assign an arraysize while runtime ? Thanks, Thomas