[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Problem with variant records?
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Problem with variant records? |
Date: |
16 Sep 2004 17:04:02 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
"John B. Wallace, Jr." <address@hidden> writes:
> Hello
>
> On my system the code below, compiled with gm2, produces this output:
> 456
> 456
>
> With two other Linux/Modula-2 compilers the output is:
> 123
> 456
>
> I am using the CVS sources from 01 September 2004 with gcc-3.3.3 on
> Red Hat 9 Linux/i586.
>
>
> MODULE TestVariantRecord;
>
> FROM StrIO IMPORT WriteLn;
>
> FROM NumberIO IMPORT WriteCard;
>
> TYPE
> String = ARRAY [0..255] OF CHAR;
> DataType = (card,string);
> RcdType = RECORD
> CASE Data : DataType OF
> card : j : CARDINAL;
> k : CARDINAL |
> string : st : String
> END (* CASE *)
> END; (* RECORD *)
>
> VAR
> R1 : RcdType;
>
> BEGIN
> WITH R1 DO
> Data := card;
> j := 123;
> k := 456;
> WriteCard(j,0);
> WriteLn;
> WriteCard(k,0);
> WriteLn
> END (* WITH *)
> END TestVariantRecord.
>
>
> John Wallace
Hi John,
Thanks for reporting it and for posting some test code, I've just seen
this as well when trying to build the ulm libraries..
Gaius