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 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-30 17:53:03 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Size and pack Date: 30 Oct 2001 17:53:03 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0110301753.2a7eaabf@posting.google.com> References: <9ff447f2.0110100005.2503bb00@posting.google.com> <3BC40DF2.9447F025@icn.siemens.de> <3bc41989.4285341@news.demon.co.uk> <9ff447f2.0110102236.712cb9ea@posting.google.com> <3bc55c38.3322217@news.demon.co.uk> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1004493183 11679 127.0.0.1 (31 Oct 2001 01:53:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 31 Oct 2001 01:53:03 GMT Xref: archiver1.google.com comp.lang.ada:15451 Date: 2001-10-31T01:53:03+00:00 List-Id: john.mccabe@emrad.com.nospam (John McCabe) wrote in message news:<3bc55c38.3322217@news.demon.co.uk>... > Depends on the compiler. The example earlier... > > > for rx_header_data_packed use record > > start_byte at 0 range 0 .. 7; > > splitter at 1 range 0 .. 7; > > command_byte at 2 range 0 .. 7; > > pad_byte_1 at 3 range 0 .. 7; > > log_num at 4 range 0 .. 31; -- Changed > > pad_byte_2 at 8 range 0 .. 7; -- Changed > > end_byte at 9 range 0 .. 7; > > lrc at 10 range 0 .. 7; > > end record; > > Could also be written as: > for rx_header_data_packed use record > start_byte at 0 range 0 .. 7; > splitter at 0 range 8 .. 15; > command_byte at 0 range 16 .. 23; > pad_byte_1 at 0 range 24 .. 31; > log_num at 0 range 32 .. 63; > pad_byte_2 at 0 range 64 .. 71; > end_byte at 0 range 72 .. 79; > lrc at 0 range 80 .. 87; > end record; > > which would remove the possibility of confusion because > of different storage unit sizes. This is FUD, the above rewriting accomplishes nothing and is wholly undesirable. No confusion arises in either case on a byte addressed machine, and on a word addressed machine, neither form is likely to give you what you want.