comp.lang.ada
 help / color / mirror / Atom feed
From: brianorpin@bigfoot.com (Brian)
Subject: Re: How to perform bit-wise xor, and...?
Date: 1996/11/24
Date: 1996-11-24T00:00:00+00:00	[thread overview]
Message-ID: <329a4c6e.13988683@news.demon.co.uk> (raw)
In-Reply-To: mheaney-ya023280002211962226310001@news.ni.net


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





  reply	other threads:[~1996-11-24  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-22  0:00 How to perform bit-wise xor, and...? Leong San Io Francisco
1996-11-22  0:00 ` Matthew Heaney
1996-11-24  0:00   ` Brian [this message]
1996-11-27  0:00     ` Robert Dewar
1996-11-22  0:00 ` Larry Kilgallen
1996-11-23  0:00   ` Leong San Io Francisco
1996-11-24  0:00   ` Michael F Brenner
1996-11-25  0:00 ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox