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: Mon, 13 Jan 2020 09:47:54 +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.
>
> 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.
>
> Maybe that's per intention - please let me know.
>
> Greetings
>
> Michael

Hi Michael,

all fixed in the trunk branch

gaius@ettarde:~/GM2$ gm2 -fiso -g mktest.mod 
gaius@ettarde:~/GM2$ ./a.out 
 TSIZE(GenOptSet) = 1
 TSIZE(BitSet8) = 1
 SYSTEM.BITSPERLOC = 8

many thanks for the bug report - I've added two regression tests - will
add a few more now that the original tests pass,

regards,
Gaius



reply via email to

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