[Oberon] OBNC Sets incorrect output
Joerg
joerg.straube at iaeth.ch
Sun Mar 20 19:51:58 CET 2022
{32} will be translated to (0x1u << 32)
I‘m not a C specialist, but shouldn‘t it read (0x1ull << 32)
br
Jörg
> Am 20.03.2022 um 19:02 schrieb Joe Turner <medianjoe at mailfence.com>:
>
>
> Jorg,
>
> Thanks for the suggestion. Unfortunately the output isn't as expected; only 31 was printed. I'll contact the author about the issue.
> cheers,
> Joe
>
> March 20, 2022 6:35:33 PM CET Joerg <joerg.straube at iaeth.ch> wrote:
>>
>> Joe
>>
>> Most probably the compiler itself is not compiled with --c-int-type=long. The difference between the first and the second are the set constants.
>>
>> To check my assumption try:
>>> MODULE testsets;
>>> IMPORT Out;
>>> VAR
>>> i : INTEGER;
>>> x,y,z : SET;
>>> BEGIN
>>> x := {}; INCL(x, 31); INCL(x, 32); INCL(x, 33);
>>> y := {}; INCL(y, 33); INCL(y, 34); INCL(y, 35};
>>> z := x - y;
>>> FOR i := 31 TO 35 DO
>>> IF i IN z THEN
>>> Out.Int(i,4)
>>> END
>>> END;
>>> Out.Ln
>>> END testsets.
>>
>> If this solved the output and you have access to the source, you could try to re-compile the compiler with the long flag turned on.
>>
>> br
>> Jörg
>>
>> --
>> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
>> https://lists.inf.ethz.ch/mailman/listinfo/oberon
> -- Sent with https://mailfence.com Secure and private email --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20220320/c0f0bad7/attachment.html>
More information about the Oberon
mailing list