Hello!
michael paap wrote:
- is it right, that gps
You probably mean GPC ...
is not compatible to standardpascal in this respect, that it does not look for the right part of a statement like the below, if the first part is true?
if (j > a) or (i[b] > a) then ...
This is true, but this does _not_ violate the standard. The ISO Standard explicitly says that it you _cannot_ rely on a specific order of evaluation of the operands - or whether they are evaluated at all.
GPC's default behaviour is to evaluate such an expression from left to right and to stop when the result is known already.
If you give GPC the `--no-short-circuit' switch, it will not specify the order of evaluation. Please note that even then you cannot be sure that both operands are evaluated.
- what does the option --pedantic do?
It swiches on warnings about anything that can cause problems with any compiler we know about. (In short: It warns about just _everything_.;-)
If you want to check whether your program complies to Standard Pascal, you can give GPC the `--standard-pascal' switch. There are several of such dialect-selecting options:
GPC option support by GPC Dialect --------------------------------------------------------------------------------- --standard-pascal-level-0 complete ISO 7185 level 0 --standard-pascal complete ISO 7185 level 1 --extended-pascal mostly complete ISO 10206 level 1 --ucsd-pascal mostly complete UCSD Pascal --borland-pascal complete Borland Pascal 7.0 --delphi partial Borland's Delphi --pascal-sc partial Pascal for scientific calculations
Giving such a switch will tell GPC to warn about everything that is not part of the selected dialect, and not to warn about some things we consider misfeatures but are part of the selected dialect. Please note that these switches do not turn anything on, but only off. Every Standard Pascal (or Borland Pascal or whatever) program that does not use CPU- and OS-specific low-level stuff (assembler and such) should compile with GPC without these switches.
Hope this helps,
Peter