da Silva, Joe wrote:
program test;
label 1;
procedure outer; label 1; procedure inner; begin {inner} goto 1 end; {inner} begin {outer} 1: end; {outer}
begin {test} 1: end. {test}
The compiler seems to think that the "goto" in the procedure "inner", goes to the label in the main program, rather than the label in the procedure "outer", which by the "rules of scope", is the appropriate label.
Indeed. Thanks. Fixed.
However, there is an additional problem which may be platform/build "specific". It seems that whenever an error or warning is issued, the compiler misbehaves, often crashing. This behaviour is inconsistent, so that consecutive runs of the compiler with the same source code and environment produce different results. When no error or warning is reported, everything seems fine and the results are consistent. Attached for example, are some screen dumps of the 20010924 DJGPP compiler, attempting to compile the above sample program.
Since I've changed a lot WRT labels in the meantime, I can't reproduce it now. Please check again with the next version.
I apologise for the poor visual quality of these screen dumps, but this was to achieve acceptable compression of the two JPEG files
For such kinds of images, PNG is much better suited than JPEG. I suppose it would archive better compression, and it would surely be more readable.
However, much better than any image is text (smaller, copyable, and I won't have to switch between my editor and GUI just to read it :-). You can use the `redir' utility under DJGPP:
# Redirect StdErr to foo redir -e foo command args
# Redirect StdOut and StdErr to foo redir -e foo -oe command foo
For more info, see the DJGPP FAQ (see redir in the index).
Frank