comp.lang.ada
 help / color / mirror / Atom feed
From: "James E. Hopper" <hopperj@macconnect.com>
Subject: Re: array size
Date: 1999/12/11
Date: 1999-12-11T00:00:00+00:00	[thread overview]
Message-ID: <111219991626224120%hopperj@macconnect.com> (raw)
In-Reply-To: 3851d15b_1@news1.prserv.net


well i tried adding

  for Day_Array_Type'Size use 7 * Preset_Array_Type_Size;

this won't compile either. i get:
test.adb:48:33: size for "Day_Array_Type" too small, minimum allowed is
1120
gnatmake: "test.adb" compilation error

could this be a gnat bug??

jim


In article <3851d15b_1@news1.prserv.net>, Matthew Heaney
<matthew_heaney@acm.org> wrote:

> In article <101219991605504828%hopperj@macconnect.com> , "James E. 
> Hopper" <hopperj@macconnect.com> wrote:
> 
> >   type Preset_Array_Type is array ( Preset_Type ) of Frequency_Type;
> >   pragma pack (Preset_Array_Type);  -- RAD SOLARIS PORT
> >   for Preset_Array_Type'Size use 6 * Frequency_Type'Size;
> 
> Always do this for composite types:
> 
>   Preset_Array_Type_Size : constant := 6 * Frequency_Type'Size;
>   for Preset_Array_Type'Size use Preset_Array_Type_Size;
> 
> 
> > -- We tried the following just for giggles but interestingly,
> > -- the compiler says that Preset_Array_Type'Size isn't static!!
> > -- for Day_Array_Type'Size use 7 * Preset_Array_Type'Size;
> 
> It said that because composite types (including arrays) are always
> nonstatic; see RM95 4.9.
> 
> The solution is easy enough:
> 
>   for Day_Array_Type'Size use 7 * Preset_Array_Type_Size;
> 
> or better
> 
>   Day_Array_Type_Size : constant := 7 * Preset_Array_Type_Size;
>   for Day_Array_Type'Size use Day_Array_Type_Size;
> 
> 
> --
> Time and again the nation's courts have ruled that creationism, as a
> religious dogma, cannot be taught in science classes. Now, creationists
> are advancing a new tactic: eliminating the teaching of evolution and
> other sciences that complement evolution, such as geology, paleontology,
> and biological anthropology. By doing so, they are not only endangering
> church-state separation but also seriously jeopardizing the science
> education of future generations.
> 
> http://www.campusfreethought.org/sos/




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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-10  0:00 array size James E. Hopper
1999-12-10  0:00 ` Matthew Heaney
1999-12-11  0:00   ` Robert Dewar
1999-12-11  0:00     ` Robert A Duff
1999-12-11  0:00       ` Matthew Heaney
1999-12-11  0:00     ` Matthew Heaney
1999-12-13  0:00       ` Robert A Duff
1999-12-11  0:00     ` James E. Hopper
1999-12-12  0:00       ` Matthew Heaney
1999-12-11  0:00   ` James E. Hopper [this message]
1999-12-11  0:00 ` DuckE
1999-12-11  0:00   ` James E. Hopper
1999-12-11  0:00     ` DuckE
1999-12-12  0:00       ` Matthew Heaney
1999-12-12  0:00       ` James E. Hopper
replies disabled

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