comp.lang.ada
 help / color / mirror / Atom feed
From: abailly <abailly@nordnet.fr>
Subject: Discrimant Record Types and GNAT
Date: 1999/01/11
Date: 1999-01-11T00:00:00+00:00	[thread overview]
Message-ID: <369A84AB.CD5B5A4D@nordnet.fr> (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






             reply	other threads:[~1999-01-11  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-11  0:00 abailly [this message]
1999-01-12  0:00 ` Discrimant Record Types and GNAT Samuel Tardieu
1999-01-12  0:00 ` Matthew Heaney
replies disabled

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