j.g.ollason wrote:
I think that I have found a bug in gpc. The following program generates what I think is a spurious error...of course I could be mistaken.
program testzero1(input,output); type seabird= record alive:boolean; tomin:real; end ; var tu:real; i,ndives:integer; cguille:seabird;
procedure zero(function target(x:real):real;lox,hix:real;var x:real; var found:boolean); begin end { zero };
function fed(var cbird:seabird;var tu:real):seabird; var found:boolean;
function oo1(var t:real):real; begin oo1:=0; end { oo1 }; begin with cbird do zero(oo1,0,10000,tomin,found); fed:=cbird; end ; begin cguille:=fed(cguille,tu); end .
The error is:
testzero1.p: In function `Fed': testzero1.p:26: type mismatch in argument 1 of `Zero'
The error is correct. In target, x is a value parameter, but in oo1, it's a reference parameter. Therefore the types don't match.
Frank