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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38ceb882eed41e1e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-28 17:01:46 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: byhoe@greenlime.com (Adrian Hoe) Newsgroups: comp.lang.ada Subject: Re: Size and pack Date: 28 Oct 2001 17:01:45 -0800 Organization: http://groups.google.com/ Message-ID: <9ff447f2.0110281701.45e0040c@posting.google.com> References: <_umC7.74983$gT6.38373531@news1.rdc1.sfba.home.com> NNTP-Posting-Host: 210.186.172.109 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1004317306 25423 127.0.0.1 (29 Oct 2001 01:01:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 29 Oct 2001 01:01:46 GMT Xref: archiver1.google.com comp.lang.ada:15318 Date: 2001-10-29T01:01:46+00:00 List-Id: tmoran@acm.org wrote in message news:<_umC7.74983$gT6.38373531@news1.rdc1.sfba.home.com>... > > > Log_Num at 5 range 0 .. 31; > > > End_Byte at 9 range 0 .. 7; > > > LRC at 10 range 0 .. 7; > > > end record; > > > for Rx_Header_Data'size use 8*11; > > > > The problem was that this rep clause will not work, because Log_Num must > > be aligned to a 4-byte boundary. Some compilers will silently ignore your > > rep clause, I believe GNAT will tell you it can't do it. > I tested it on Gnat 3.13p on Windows before posting, and Gnat was > perfectly happy with it. And ARM 13.5.1(23) says that "If component > clauses are given for all components, the record representation clause > completely specifies the representation of the type and will be obeyed > exactly by the implementation." That seems pretty unambiguous to me. I tested the code on GNAT 3.13p-7 on Linux and it works! Is having, "for Rx_Header_Data'size use 8*11;" better than pragma pack? What is the rational? I suppose the former tells the compiler exactly how many bytes/bits to be allocated for Rx_Header_Data. Adrian Hoe