label used before containing beinding contour problem
Hi! I've encountered the message in the subject trying to compile the following: program x(input, output); label x_label; var z:integer; w:string; function f:string begin f:='f'; end; begin if z = 1 then begin writeln('to x_label'); goto x_label; end; w:= 'z:'+f; x_label:; end. Compilation fails and I get: x.pas:3: label 'x_label' used before containing binding contour. If I surround w:= 'z:'+f; with 'begin/end' then everything compiles. also if summation is not on string everything compiles. I use "gpc version 20030507, based on gcc-3.2.1" I've found in the archive message #2535 descring the same problem. However the message seems to be unanswered, at least the answer was not on the archive.... Thank you in advance, Nick Ioffe ===================================================== message #2535 From: Berend de Boer Subject: label used before containingn binding contour Date: 29 Jan 1999, 21:01:21 Since about 5 years I try to compile lex for extended pascal with gpc. However, I still don't succeed. This program is a real test case I assume :-) Here the latest error, boiled down to the most minimal code: ------------------------ program Test; type string255=string(255); function Test(filename, ext : String): string255; label 1,2; begin Test := ''; goto 1; goto 2; 2: Test := filename+'.'; 1: ; end; begin end. ------------------------ Groetjes, Berend. =======================================
participants (2)
-
"Nick Ioffe -
Frank Heckenbach