gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Bug in FOR Statement?


From: Gaius Mulley
Subject: Re: [Gm2] Bug in FOR Statement?
Date: 19 Nov 2005 07:59:01 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Juan Reyes <address@hidden> writes:

> Hi to all,
> first of all, thanks for your job on developing this compiler.
> I have recently installed the compiler and works fine,
> but I found that when I compile and run this code:
> 
> MODULE fortest;
> 
> FROM InOut IMPORT WriteInt,WriteLn;
> 
>    VAR N,i: INTEGER;
> 
> BEGIN
>   N:=2;
>   FOR i:=N TO 1 BY -1 DO
>   WriteInt(i,2);
>   END;
>   WriteLn;
> END fortest.
> 
> 
> I get this output:
> 
>  2 1 0
> 
> So the FOR statement is evaluated 3 times instead of  2¿?
> 
> If in the FOR line you change N by 2 (or a constant), then the output is OK.
> 
> The version is 2005-11-15 with gcc 3-3-6.

Hi Juan,

thanks for the bug report - indeed a bug in the for loop,
I'll look into it asap..

regards,
Gaius



reply via email to

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