[fpc-devel]Possible Compiler bug in FPC 1.04 under Win32?

Peter Vreman peter at freepascal.org
Wed Jan 17 13:54:20 CET 2001


> Hi!
> 
> When i compile the attached source code i got some strange 
> errors.
> 
> --snip--
> Compiling devpdflib.pas
> devpdflib.pas(88,27) Error: Incompatible types: got "<procedure variable
> type of function():SmallInt;ClearStack;Cdecl>" expected "SMALLINT"
> devpdflib.pas(104,27) Error: Incompatible types: got "<procedure
variable>  type of function():SmallInt;ClearStack;Cdecl>" expected "SMALLINT"
> devpdflib.pas(120,14) Error: Incompatible types: got "<procedure
variable>  type of function():^TPDF;ClearStack;Cdecl>" expected "PPDF"
> devpdflib.pas(138) Fatal: There were 3 errors compiling module, stopping
> --snip--
> 
> The source code is for first error:
> 
> type
>   TPDF_get_majorversion =function:Integer cdecl;
> var
>   FPDF_get_majorversion :TPDF_get_majorversion;
> 
> function PDF_get_majorversion:Integer;
> begin
>   PDF_get_majorversion:=FPDF_get_majorversion;

Use
   PDF_get_majorversion:=FPDF_get_majorversion();

> end;
> 
> The function call returns an error.
> Does anyone knows why?

Read porting TP code to FPC code about procedure variable differences







More information about the fpc-devel mailing list