comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Allocation questions
Date: Thu, 28 May 2009 05:19:31 -0700 (PDT)
Date: 2009-05-28T05:19:31-07:00	[thread overview]
Message-ID: <96a89bf4-4968-45fb-aa5b-4a47f2e06045@f19g2000yqo.googlegroups.com> (raw)
In-Reply-To: gvlu2r$ejr$1@ccpntc8.in2p3.fr

xavier grave:
> > Or you could use a discriminant:
>
> >    type Samples (No_Of_Samples : Natural := 0) is
> >       record
> >          S : array (1 .. No_Of_Samples) of Sample;
> >       end record;
>
> My two cents about variant discriminant : IMHO one should avoid to
> declare No_Of_Samples as Natural and with a default value, because as
> far as I remember some compilers will book for S (1 .. Natural'Last) of
> Sample which can be a lot...
>
> May be some compiler guru can confirm or infirm this ?

I confirm this with GNAT even though I'm no guru. Well spotted,
Xavier.

--
Ludovic Brenta.



  reply	other threads:[~2009-05-28 12:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28  9:46 Allocation questions Olivier Scalbert
2009-05-28 10:02 ` Martin
2009-05-28 11:55   ` xavier grave
2009-05-28 12:19     ` Ludovic Brenta [this message]
2009-05-28 13:00       ` Georg Bauhaus
2009-05-28 23:13       ` Robert A Duff
2009-05-28 10:05 ` Dmitry A. Kazakov
2009-05-28 10:40   ` Martin
2009-05-28 12:32     ` Olivier Scalbert
2009-05-28 13:39       ` Martin
2009-05-28 13:57         ` Olivier Scalbert
2009-05-28 14:51         ` Adam Beneschan
2009-05-28 17:58           ` Randy Brukardt
2009-05-28 14:04       ` Dmitry A. Kazakov
2009-05-28 16:59 ` Jeffrey R. Carter
2009-05-28 17:26   ` Olivier Scalbert
replies disabled

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