Not sure why you are doing things this way, anyhow ...
Why not eliminate the non-standard "BitSize" function?, thus :
program tst;
const
BitArraySize = 19;
var
aa : packed array [1..BitArraySize] of boolean;
begin
......
Also, why are you using a pointer to your array, why not simply
pass it to your "Find_First_bit_Set" function as a parameter (var
parameter, if you wish)?
Joe.
> -----Original Message-----
> From: Nick Ioffe [SMTP:ioffe_nick@mail.ru]
> Sent: Tuesday, August 06, 2002 5:49 AM
> To: gpc(a)gnu.de
> Subject: Some strange behaviour of GPC
>
> Hi!
>
> I use packed arrays of booleans and need to look for bit
> set and clear in them.
>
> The arrays are of different sizes, but I cannot use a conformant
> array.
>
> I've written function
> Find_First_bit_Set (buff_ptr:pointer,
> bit_size:integer) : integer;
>
> and then to pass Addr(bit_array) and BitSizeOf(bit_array).
>
> The problem is that for BitSizeOf (packed array of boolean)
> always returns me 8*SizeOf like in the following case:
> program tst;
> var
> aa : packed array [1..19] of boolean;
> begin
> writeln (SizeOf(aa), ' ', BitSizeOf(aa));
> end.
>
> the output I get is:
> 4 32.
>
> what can be wrong?
>
> I use GPC 2.1 compiled on HP-UX B.11.00
>
> Thank you in advance,
> Nick
>