Hello,
On Thu, 19 Dec 2002, Frank Heckenbach wrote:
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).
It wasn't my intension to repeat things you already know about. In particular, I omitted bugs I reported on comp.lang.pascal.ansi-iso, like the "-1 mod 2" problem.
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.
I wrote all the test programs a month ago. The only change I made before re-posting them to the list was inserting question mark after the word "latest".
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?
That is my understanding of the standard. Not that it would mean anything, but even in Turbo Pascal "writeln(3:2:1)" is an error.
For a somewhat less obvious case try:
program az46(output); (* FLAG --classic-pascal *) begin writeln('failed: ',round(1)) (* WRONG - parameter of "round" should be of real-type *) end.
GNU Pascal issues a warning here; I believe that ISO says it is illegal.
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?
Yes, I think it is.
Regards,
Artur Zaroda zaroda@mimuw.edu.pl