comp.lang.ada
 help / color / mirror / Atom feed
* error in index constraints with initial value
@ 2002-04-04 17:25 Thomas Haeckel
  2002-04-04 17:41 ` Marin David Condic
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Haeckel @ 2002-04-04 17:25 UTC (permalink / 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



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

end of thread, other threads:[~2002-04-04 20:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-04 17:25 error in index constraints with initial value Thomas Haeckel
2002-04-04 17:41 ` Marin David Condic
2002-04-04 17:48 ` Toshitaka Kumano
2002-04-04 20:19 ` Frank J. Lhota

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