Scott Moore wrote:
I have completed a periodic update of a review for the GPC compiler with respect to its' ability to compile and run ISO 7185 level 0 standard programs. I present it here in advance of posting it on the web site:
http://www.moorecad.com/standardpascal/compiler.html
In order to give the members of the GPC group a chance to correct any errors or raise any complaints.
You will please note that there is a section for GPC originator comments. I would be happy to accept any reasonable section the GPC group would wish to include in that section, limited only by size and taste concerns.
I note that the web page for GPC does not specify who speaks for GPC, so I would only ask that if multiple people wish to post such a comment, the GPC group would work between its members to prepare a coordinated submittal.
Thank you,
Scott Moore
<below contains the review> ======================================================================== GPC
Last verified: November 25, 2007 ISO 7185 full standard test: One failure (see explanation)
My comments:
- Test failure on ISO 7185 section 6.4.3.5, specifically the
requirement that each line consist of a sequence of characters terminated by the eoln sequence. When a temporary (unnamed) file was output with an incomplete last line, and subsequently read back, the last eoln was found to be missing. The responsible parties for GPC have informed me that this problem has been fixed in the current version of GPC. When I am able to obtain and test that version, I will update this information.
The paragraph above is a misunderstanding: the behaviour you see is _expected_ in default GPC mode. Only if you give '--standard-pascal' flag you should get standard compiant behaviour. If you care only about this problem updating to newer version is both useless and not necessary: starting from (at least) May 2004 all versions should behave the same.
- The GPC documentation inaccurately states that the flag
"--standard-pascal" is all that is needed to insure ISO 7185 level 0 compliance. In fact, this switch was found broken at the time of testing, and caused several normal ISO 7185 features to be incorrectly flagged as errors/warnings. In addition, the flag --field-widths was found to be needed. Finally, the version tested output several warnings with no relationship to Pascal (in fact, they were C language warnings). The net command syntax required to accurately compile ISO 7185 Pascal using GPC is:
gpc --field-widths -Wno-warnings -o <program> <program>.pas
Where <program> is the name of the Pascal program to be compiled.
You did not show us any example warnings, so we can not tell if warnings are justified. Note however, that warnings are about _legal_ constructs which are considered to be likely errors, and that likely errors depend on preferred programming style which is highly subjective.
Concerning errors: you reported 3 errors. One is fixed in widely distributed versions (starting from 20060215), the other 2 were new ones and currently require applying a patch. I know about a few other cases where version 20051116 with the "--standard-pascal" flag rejected valid programs which were fixed in gpc-20060215.