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-Thread: 103376,b657b1c99e7e7039 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!xlned.com!feeder1.xlned.com!goblin2!goblin.stu.neva.ru!news.neu.edu.cn!newsgate.cuhk.edu.hk!news.netfront.net!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: bit numbers in packed arrays of Boolean Date: Tue, 31 Aug 2010 11:13:56 -0700 Organization: Netfront http://www.netfront.net/ Message-ID: References: <82r5hfghjr.fsf@stephe-leake.org> NNTP-Posting-Host: 69.97.125.131 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: adenine.netfront.net 1283278437 26675 69.97.125.131 (31 Aug 2010 18:13:57 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Tue, 31 Aug 2010 18:13:57 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 In-Reply-To: <82r5hfghjr.fsf@stephe-leake.org> Xref: g2news1.google.com comp.lang.ada:13882 Date: 2010-08-31T11:13:56-07:00 List-Id: On 08/31/2010 04:14 AM, Stephen Leake wrote: > > LRM 13.9(5) says Bit_Array_16_Type and Unsigned_16 have the same > representation, but it does not specifically address the index order. > > Is this bit order required by some other clause? Do other compilers > follow it? Packed arrays of Boolean have been around since Ada 80, and prior to Ada 95 were the only way to access individual bits. Note that the Boolean operations "and", "or", "xor", and "not" may be applied to such arrays. Unfortunately, the ARM does not specify how indices are mapped to individual bit positions, so this is entirely compiler dependent. Typically compilers map the lowest index onto the lowest bit number supported by the H/W, so this depends on the platform, but the ARM allows any mapping from indices to bit positions. As a result, any use of packed arrays of Boolean to access specific bits is not portable. -- Jeff Carter "C++ is like giving an AK-47 to a monk, shooting him full of crack and letting him loose in a mall and expecting him to balance your checking account 'when he has the time.'" Drew Olbrich 52 --- news://freenews.netfront.net/ - complaints: news@netfront.net ---