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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,13f10cac2d21b84f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-26 09:36:18 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: robert_s_quinn@yahoo.com (Robert Quinn) Newsgroups: comp.lang.ada Subject: Is this a GNAT bug??? Date: 26 Apr 2002 09:36:17 -0700 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 63.169.26.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1019838978 11769 127.0.0.1 (26 Apr 2002 16:36:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 26 Apr 2002 16:36:18 GMT Xref: archiver1.google.com comp.lang.ada:23144 Date: 2002-04-26T16:36:18+00:00 List-Id: I originally posted a question regarding pragma pack, but after stripping away all the details I found what may be a bug, or just something I don't understand about low level programming. I will post it, and it is brief code, but in a nutshell an array of 64 bits packs fine, but an array of 65 bits does not! I will post code here that is actually compilable, unlike my last message :) I am using gnat3.13p on Sparc Solaris Here is the WORKING, NO ERRORS code: package test is type ONE_BIT_TYPE is range 0..1; for ONE_BIT_TYPE'SIZE use 1; type ARRAY_OF_64_BITS_TYPE is array (1..64) of ONE_BIT_TYPE; pragma pack (ARRAY_OF_BITS_TYPE); type MY_TYPE is record ARRAY_OF_64_BITS : ARRAY_OF_64_BITS_TYPE; end record; pragma pack (MY_TYPE); for MY_TYPE use record ARRAY_OF_64_BITS at 0 range 0..63; end record; end test; ** NOW just replace 64 with 65 (and 63 with 64 on range) and Voila', you get the error: "size of ARRAY_OF_65_BITS too small, minimum allowed is 72" Here is the OFFENDING code: package test is type ONE_BIT_TYPE is range 0..1; for ONE_BIT_TYPE'SIZE use 1; type ARRAY_OF_65_BITS_TYPE is array (1..65) of ONE_BIT_TYPE; pragma pack (ARRAY_OF_BITS_TYPE); type MY_TYPE is record ARRAY_OF_65_BITS : ARRAY_OF_65_BITS_TYPE; end record; pragma pack (MY_TYPE); for MY_TYPE use record ARRAY_OF_65_BITS at 0 range 0..64; end record; end test; So why can't I pack a bit array of 65 bits or more bits? Anyone have any comments?