comp.lang.ada
 help / color / mirror / Atom feed
* Discrimant Record Types and GNAT
@ 1999-01-11  0:00 abailly
  1999-01-12  0:00 ` Samuel Tardieu
  1999-01-12  0:00 ` Matthew Heaney
  0 siblings, 2 replies; 3+ messages in thread
From: abailly @ 1999-01-11  0:00 UTC (permalink / raw)


I've got problems with using discrimant record types with defaults
values
For example :

type Tab is array(POSITIVE range <>) of TOTO;
type REc (taille : NATURAL := 0) is record
    t : tab(1..taille);
end record;

I've been taught by my Ada teacher that this kind of object could be
declared as
tab1 : Rec;
and then used with tab1 := <any_rec>
effectively creating an unconstrained array.

However, when I compile something like that with GNAT (3.10p on a
Linux-i586 box)
I get warnings at compile time and STORAGE_ERROR at runtime, which is
not the case
with another compiler we are using for lessons.

Anyone got an answer to this problem ?

Thank you in advance

Arnaud BAILLY






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

end of thread, other threads:[~1999-01-12  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-11  0:00 Discrimant Record Types and GNAT abailly
1999-01-12  0:00 ` Samuel Tardieu
1999-01-12  0:00 ` Matthew Heaney

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