"J. David Bryan" wrote:
On 11 Oct 2001, at 14:17, CBFalconer wrote:
PascalP is fairly stringent.
To which Pascal standard? There are several.
ISO level 0. I thrashed it with the validation suite almost 20 years ago. Now I no longer have the suite, and can't seem to get it without heavy fees. It has failings about procedures as parameters and gotos out of procedures (not implemented).
My question is: why does GPC fail to pick up these errors?
Because it's not an error in "GNU Pascal," which is what GPC compiles by default.
Do I have to do some configuration to get it conformant?
Try "gpc -c --standard-pascal test.pas" for conformance with ISO-7185.
See:
http://agnes.dida.physik.uni-essen.de/~gnu-pascal/gpc_101.html#SEC101
for additional "conformance" options.
Will do, when on line later.
Tried that command, with the following (after the string declaration changes I posted before)
[1] c:\dnld\scratch>gpc -c --standard-pascal test.p test.p: In procedure `Setit': test.p:14: warning: ISO Pascal requires `packed' for fixed strings test.p:14: warning: ISO Pascal requires `packed' for fixed strings test.p: In main program: test.p:23: type mismatch in argument 1 of `Setit' test.p:25: warning: ISO Pascal requires `packed' for fixed strings test.p:29: warning: ISO Pascal requires `packed' for fixed strings
while the equivalent PascalP (lines edited for email wrap)
[1] c:\dnld\scratch>pascalp test.p PASCALP (pasctext, pasclist, prr, ef, output) [parm] V 3.1.9T 17000 0:d var **** ^17 17. Error in declaration part 23000 60: 1 SetIt(ThisRec.LetterName[ThisLetter], **** ^68 ^109,68 68. Illegal parameter substitution 109. Attempt to load the address of an expression 27000 169: 1 ThisRec.LetterName[ThisLetter]:=Chr(Ord(... **** ^55 55. Operand type conflict
NO. ERRORS=5 WARNINGS=0 Program size(pcode bytes)=249
I want to configure it (new at this package) so it picks up all non-standard stuff by default. I don't want Extended Pascal nor Object Pascal compliance, and certainly not Borland (unless I tell it so explicitly). I did something in rhide, but it doesn't seem to stick, nor does it carry over to command line use. Level 1 compliance is fine.
Does it read an environment variable for defaults, perchance?
Just the fact that this thread ever started is worrysome. I could see it in C, but Pascal is supposed to prevent such things.