Artur Zaroda wrote:
All the tests below were on the latest (?) binary release of GNU Pascal for mingw. The result of "gpc -v" is:
gpc version 2.1 (20020510), based on 2.95.3-6 (mingw special)
I'm interested in standard (ISO) modes, especially ISO 7185, so I have been using the "--classic-pascal" option. I'm only indicating that (in FLAG comments) where I suspect that, what GNU Pascal currently does may be appropriate, when standard compliance is not requested.
Thanks very much for the test programs. This was certainly the largest set of bug reports submitted at any one time. :-)
Apparently you've been very thorough, since you've covered some issues that were discussed here recently (such as declaring an identifier as a variable while using it as a type).
BTW, we've had some alpha versions after 2.1, and a few of your tests (31, 38, 40, 41, 42) have been fixed meanwhile.
Fortunately, most of the other ones seem rather easy to fix, but there are some tricky problems. I'll have to see when I can get to them ...
Some comments to a few tests:
Correct programs, which don't compile:
(* az19.pas: In main program: az19.pas:4: division by zero *) program az19(output); begin if false then writeln('failed: ',1/0) else writeln('OK') end.
I've read the discussion in the newsgroup. I tend to agree with Chuck (IIRC) that it would be better to reject this at compile time, but it seems we have no choice. :-(
So I'll turn this error into a warning (which seems to satisfy the second alternative of 5.1 f) plus a runtime error -- but I think only in CP/SP mode.
program az33(output); begin writeln('failed: ',3:2:1) (* WRONG - that form is only applicable to reals *) end.
Just to be sure, assignment compatibility from integer to real doesn't come into play here? After looking in the standard, it seems it doesn't, so one can't say that an integer value can be used wherever a real value is expected. Right?
program az35(output); var output:file of real; begin writeln('failed') (* WRONG - output is not of type "text" *) end.
Is it not already an error to (re)declare `Output' as a variable?
Frank