{ Propably any bug in gpc 2.0 (GNU Pascal) }
program Bug1(Input,Output);
type
Str255=String(255);
procedure Gogo(S:String; var SOut:Str255);
begin
WriteLn(' Before Error ');
SOut:='aha'; { ! ?GPC runtime error: runtime error (#-1) ! }
WriteLn(' After Error ');
end;
var
S:Str255;
begin
S:='1234';
Gogo(S,S);
end.
{ Bug #2 ! }
program Bug2(Input,Output);
type
Str255=String(255);
var
I:Integer;
function Gogo(S:String):Str255;
begin
WriteLn(' Gogo ');
Inc(I);
Gogo:=S;
end;
var
S:Str255;
begin
I:=0;
S:='1234';
S:=Gogo(S); { ! No one call Gogo bat three calls ! }
WriteLn(I); { ! I=3 I!=0 }
end.
{ Please send my if you know any solution
srbt(a)fsid.cvut.cz }
.