comp.lang.ada
 help / color / mirror / Atom feed
From: thomas_haeckel@web.de (Thomas Haeckel)
Subject: error in index constraints with initial value
Date: 4 Apr 2002 09:25:42 -0800
Date: 2002-04-04T17:25:42+00:00	[thread overview]
Message-ID: <21b0043b.0204040925.4654c421@posting.google.com> (raw)

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



             reply	other threads:[~2002-04-04 17:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-04 17:25 Thomas Haeckel [this message]
2002-04-04 17:41 ` error in index constraints with initial value Marin David Condic
2002-04-04 17:48 ` Toshitaka Kumano
2002-04-04 20:19 ` Frank J. Lhota
replies disabled

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