From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af7d617cad40d0b X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Problem with representation clause Date: 1997/12/09 Message-ID: <66jcrm$q7o$1@polo.advicom.net>#1/1 X-Deja-AN: 296573275 References: <66gvas$pmp@remus.rutgers.edu> Distribution: world X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: ADViCOM -- Advanced Internet Communications Newsgroups: comp.lang.ada Date: 1997-12-09T00:00:00+00:00 List-Id: Hi The problem would seem to be the implementation advice given in the Ada95 LRM 13.2(9), viz.: For a packed array type, if the component subtype's Size is less than or equal to the word size, and Component_Size is not specified for the type, Component_Size should be less than or equal to the Size of the component subtype, rounded up to the nearest factor of the word size. So the solution would seem to be to use a two-dimensional array of your two-bit components -- i.e. : type Global_Integrity_Array_2 is array( Slot_Number, Slot_Number ) of Measurement_Status_Value; pragma Pack(Global_Integrity_Array_2); The gnat compiler gives this array a size of 1152 bits. Fabrizio Castrotorres wrote in message <66gvas$pmp@remus.rutgers.edu>... >Hi, > >Given the code: >-- START CODE > > > 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'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'Size use 24*48; -- REPRESENTATION 2 > pragma Pack(Global_Integrity_Array); > >-- END CODE > >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 ? > >Please reply to fcastrot@ccmail.avionics.itt.com > >Thanks >