[fpc-pascal]Compiler Bug in 1.0.2

md md at realmwireless.com
Thu Nov 16 21:53:46 CET 2000


There is a mild bug in the compiler. Linux. Delphi Mode. 1.0.2

Compiling functions expecting pointer to structure

type 

TMESS = record
one : integer ;
two : integer ;
end;
PMESS = ^TMESS ;

function whatever(arg1 : integer; arg2 : PMESS)  : integer ;

Compile a program which calls function whatever.

var
 testarg : PMESS ;
begin

RESULT := whatever(3,testarg) ;

end;

Compiler will throw an error:

94: Incompatible type for arg no 2, Got PMESS, expected PMESS.

To fix the problem, use this code:

RESULT := whatever(3,PMESS(testarg)) ;

Will compile fine.

Thanks,

Mark Diener




More information about the fpc-pascal mailing list