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=0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ee7e80feb46de7ac X-Google-Attributes: gid103376,public From: brianorpin@bigfoot.com (Brian) Subject: Re: How to perform bit-wise xor, and...? Date: 1996/11/24 Message-ID: <329a4c6e.13988683@news.demon.co.uk>#1/1 X-Deja-AN: 198469570 x-nntp-posting-host: borpin.demon.co.uk references: <5747oa$svi@umacss1.umac.mo> content-type: text/plain; charset=us-ascii mime-version: 1.0 reply-to: brianorpin@bigfoot.com newsgroups: comp.lang.ada Date: 1996-11-24T00:00:00+00:00 List-Id: mheaney@ni.net (Matthew Heaney) wrote: >Many people don't realize that in Ada, type Boolean, and arrays of type >Boolean, have special semantics. > >The Ada standard states that Boolean'Size is 1. > >The Ada standard states that if you pragma Pack an array whose component >subtype has a size of 1, then the array type is guaranteed to have its >components in contiguous bits. > >That means you can pragma Pack an array of Boolean, and each element of the >array will occupy contiguous bits of storage. > But don't bet on it especially if you are using a 'Meridian' (ugh!) complier as it doesn't as many hours of frustrating debugging proved! They were generous enough to provide a 'Bit Ops' package that allowed Shift etc of a low level type. Unchecked conversion is also dodgy (I deleted that bit); it is sometimes better to use 'Address instead. Brian