gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of packed sets


From: Gaius Mulley
Subject: Re: Size of packed sets
Date: Sat, 04 Jan 2020 16:23:20 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Michael Riedl <address@hidden> writes:

> Gaius,
>
> first of all a happy new year to you.

Hi Michael,

thank you and likewise

> Can you please have a short look on the attached code.
>
> MODULE mktest;
>
> FROM SYSTEM IMPORT TSIZE,BITSPERLOC;
> FROM SWholeIO IMPORT WriteCard;
> FROM STextIO IMPORT WriteString,WriteLn;
>
> TYPE GenOpts = (opt1,opt2,opt3,opt4,opt5,opt6,opt7,opt8);
> GenOptSet = PACKEDSET OF GenOpts;
>
> TYPE BitSet8 = PACKEDSET OF [0..BITSPERLOC - 1];
>
> BEGIN
> WriteString(" TSIZE(GenOptSet) = "); WriteCard(TSIZE(GenOptSet),1);
> WriteLn;
> WriteString(" TSIZE(BitSet8) = "); WriteCard(TSIZE(BitSet8) ,1);
> WriteLn;
> WriteString(" SYSTEM.BITSPERLOC = "); WriteCard(BITSPERLOC ,1);
> WriteLn;
> END mktest.
>
> I am wondering why the size of BitSet8 and GenOptSet is 4 bytes -
> would have expected 1.

yes indeed this is a bug (checked against gm2+gcc-9.1.0 and
gm2+gcc-trunk).  I'll add a regression test and fix.

Many thanks for the bug report,

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]