comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Problem with representation clause
Date: 1997/12/08
Date: 1997-12-08T00:00:00+00:00	[thread overview]
Message-ID: <mheaney-ya023680000812972317260001@news.ni.net> (raw)
In-Reply-To: 66gvas$pmp@remus.rutgers.edu


In article <66gvas$pmp@remus.rutgers.edu>, castroto@remus.rutgers.edu
(Fabrizio Castrotorres) wrote:

Try adding the Component_Size attribute too.

>   type Measurement_Status_Value is range -2 .. 1;
>   for  Measurement_Status_Value'Size use 2;
>
>   type Slot_Number is range 0 .. 23;
>
>   type Integrity_Data is array (Slot_Number) of Measurement_Status_Value;

    for Integrity_Data'Component_Size use 2;

>   For Integrity_Data'Size use 24*2;   -- REPRESENTATION 1
>   pragma Pack(Integrity_Data);


>   type Global_Integrity_Array is array( Slot_Number ) of Integrity_Data;

   for Global_Integrity_Array'Component_Size use 24 * 2;

>   For Global_Integrity_Array'Size use 24*48;  -- REPRESENTATION 2
>   pragma Pack(Global_Integrity_Array);

>The GNAT ADA 95 compiler (the one with the graphical user interface for NT/95)
>lets th file compile fine. The problem comes when I try to build the main 
>module which uses this package specification (no body). It
>gives me the following error message:
>
>size for "Global_Integrity_Array" too small, minimun allowed is 1536
>
>
>The size I specified is             24*(24*2) = 1152 bits
>The size the compiler requires is   24*(32*2) = 1536 bits
>
>Is there a pragma I overlooked, specification I can write/correct, or command
>line switch I need, in order to fix this ?

You have to use both pragma Pack and T'Component_Size.  See RM95 13.2 (9),
AARM 95 13.3 (52.c), AARM 95 13.3 (53, 53.a), and in particular AARM 95
13.3 (73, 73.a).

--------------------------------------------------------------------
Matthew Heaney
Software Development Consultant
<mailto:matthew_heaney@acm.org>
(818) 985-1271




  parent reply	other threads:[~1997-12-08  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-08  0:00 Problem with representation clause Fabrizio Castrotorres
1997-12-08  0:00 ` Jeff
1997-12-09  0:00   ` David C. Hoos, Sr.
1997-12-08  0:00 ` Matthew Heaney [this message]
1997-12-09  0:00   ` David C. Hoos, Sr.
1997-12-09  0:00 ` David C. Hoos, Sr.
1997-12-10  0:00 ` Aaro Koskinen
replies disabled

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