da Silva, Joe wrote:
PROGRAM testnn1;
BEGIN writeln('Testnn fails to detect lack of output file parameter'); (* here is needed a way to return a status *) (* which is missing from ISO Pascal *) (* PascalP uses "terminate(integer)" extension *) END.
This produces a warning with `gpc --standard-pascal'. If you want it to be an error, add `-Werror'.
[Joe da Silva]
Clearly, "output" IS being used by this program, so the fact that it's missing as a parameter of the program, is clearly an error (unless of course, you are compiling to the Borland dialect). If GPC can deal with this (which AFAIK it can), then it's a "non-fatal" error. IMHO, a warning should result only when something is "suspicious", rather than when something is clearly erroneous, as in this example.
OK, I'm changing these to real errors with `--standard-pascal'. However, I don't think the standards define warnings at all, so you might want to consides `gpc --standard-pascal -Werror' a candidate for a standard-compliant compiler. ;-)
I'm putting it in the test suite (chuck1.pas), so we can fix it sometime. (Though I must admit that the priority isn't very high, at least for me, since I don't program in plain SP myself, and see such restrictions as rather limiting -- mixing declaration blocks allows for more "topic oriented" structuring. But, of course, to be really conformant, GPC must detect this in the future.)
[Joe da Silva]
What do you consider "Standard"??? As far as I'm concerned, ISO-10206 is the standard to which GPC aspires, so why should GPC regard the above as an error, when this is clearly permitted by ISO-10206. IMHO, ISO-7185 should not be regarded as if it's the one and only Pascal standard. Prospero call this version of the language "Classic Pascal", to distinguish it from "Extended Pascal". I like that idea. I don't think it helps Pascal's image to always refer to ISO-7185 as THE Pascal standard, since this gives the impression of a very restricted and limited language, which is not something that Pascal deserves. I think we should promote the ISO-10206 standard, not pretend there is only one Pascal standard. (Rant over ;-)
Well, in theory I'd agree, but the terminology that's been used in GPC for a long time is to call ISO-7185 "Standard Pascal" and ISO-10206 "Extended Pascal". Though that's not quite accurate, since 10206 is also a standard, I'm not sure if it's worth the trouble to rename things (including, e.g., the option `--standard-pascal') now ...
Frank