Waldek Hebisch wrote:
CBFalconer wrote:
loop lopy wrote:
I have changed from gpc into turbo pascal. The code that compiled for me in gpc doesnt compile now in turbo pascal. The code:
type NumNode = record Value: integer; pNext: ^ NumNode; end;
The compile error I get: Undefined type in pointer definition (NUMNODE)
Apart from the fact that TP can't compile Pascal, that shouldn't compile anywhere. You can't use NumNode until it is defined, and it isn't defined until the "end;" is encountered. Except to forward define a pointer type. Thus you need: Get a Pascal book.
AFAICS code written by loopy is perfectly legal standard pascal.
I agree (and GPC accepts it).
BTW, gpc, Pascal P4 and Stanford Pascal allow the following (illegal) code:
Yes, we've already discussed that GPC's type checking is not quite correct (mostly, it's too lax with pointer types AFAIK). If you want to improve it (as you mentioned once), just go ahead -- I probably won't get to that area soon.
Frank