Hi! As I told I have some problems in the last GPC version (20030507) with repeated declaration in implementation part. consider the following: module test1 interface; export test1=all; procedure mt1 (str:string); function mt2 (str:string):string; end.
module test1 implementation; procedure mt1 (str:string); begin writeln (str); end; function mt2 (str:string):string; begin mt2:=str; end; end.
this file doesn't compile. GPC tells that mt2 redeclaration doesn't match the first one.
The funny thing is that if I add type mystr=string after the "export" line and then change the function to use mystr - everything compile.
Nick
nick wrote:
function mt2 (str:string):string;
this file doesn't compile. GPC tells that mt2 redeclaration doesn't match the first one.
The funny thing is that if I add type mystr=string after the "export" line and then change the function to use mystr - everything compile.
That's recommended, aynway. Assuming capacity 255 is only for backward-compatibility to BP (which can't be an issue if you're using modules).
Anyway, this patch will fix the bug (nick2.pas). After applying the patch, you must remove all GPI files and build them again!
Frank
----- Original Message ----- From: "Frank Heckenbach" frank@g-n-u.de To: gpc@gnu.de Sent: Monday, July 28, 2003 16:25 Subject: Re: Redelaration problems.
nick wrote:
function mt2 (str:string):string;
this file doesn't compile. GPC tells that mt2 redeclaration doesn't
match the first one.
The funny thing is that if I add type mystr=string after the "export" line and then change the function to use mystr -
everything compile.
That's recommended, aynway. Assuming capacity 255 is only for backward-compatibility to BP (which can't be an issue if you're using modules).
I see. You're right.
Anyway, this patch will fix the bug (nick2.pas). After applying the patch, you must remove all GPI files and build them again!
Thank you for the patch!
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88
1707