On 5 Nov 2005 at 19:08, Waldek Hebisch wrote:
Prof A Olowofoyeku wrote:
I converted one small project from using OBJECTs to using CLASSes.
The test program compiles and runs okay under Delphi, Virtual Pascal, and FreePascal.
The new GPC snapshot comes up with some compilation errors. You can see the error log in the attached zip file. Also in the zip file are the sources, and the test program's outputs when compiled with Delphi 7 (d7.txt), FreePascal (fpc.txt), and Virtual Pascal (vp.txt).
: baseobj.pas:52: method `init', overrides parent method : baseobj.pas:253: method `init', overrides parent method
The two errors above (and more in the following) are because GPC is more strict by default. You can write:
CONSTRUCTOR init ( Owner : TClass ); override;
I couldn't do it. The constructor in the ancestor was static, not virtual. And couldn't do it if the ancestor was virtual either - because the declarations were not identical.
or
CONSTRUCTOR init ( Owner : TClass ); reintroduce;
Reintroduce didn't seem appropriate (although Delphi 7 accepts it here). I didn't think it applied when what you are replacing is a static method ...
[...]
: baseobj.pas: In constructor `TBaseList.init': : baseobj.pas:437: expression used as a statement : baseobj.pas: In destructor `TBaseList.done': : baseobj.pas:454: Delphi/OOE continuing destructor activation unsupported
The patch below should fix those (with the patch I was able to compile your test program and got the same results as in enclsed output files)
[...]
Works here as well - thanks ...
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/