[fpc-pascal]Strange Compiler Bug

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Feb 28 14:08:45 CET 2002


Hi all,

I found a compiler bug, which I don't know how to report to the bug list.
I can't give a simple example, so I will describe it.
If I clean up and do a complete compile the compiler gives the following:

[mattias at limoooh codetools]$ rm -f *.{o,ppu}; ppc386 allcodetoolunits.pp 
Free Pascal Compiler version 1.0.5 [2002/02/25] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling allcodetoolunits.pp
Compiling memcheck.pas
Assembling memcheck
Compiling codetoolmanager.pas
Compiling codecompletiontool.pas
Compiling codetree.pas
Compiling basiccodetools.pas
Compiling sourcelog.pas
Assembling sourcelog
Compiling keywordfunclists.pas
Assembling keywordfunclists
Assembling basiccodetools
Compiling avl_tree.pas
Assembling avl_tree
Compiling codetoolmemmanager.pas
Assembling codetoolmemmanager
Assembling codetree
Compiling codeatom.pas
Compiling codecache.pas
Compiling linkscanner.pas
Compiling expreval.pas
Assembling expreval
Assembling linkscanner
Compiling fileprocs.pas
Assembling fileprocs
Assembling codecache
Assembling codeatom
Compiling pascalparsertool.pas
Compiling customcodetool.pas
Compiling sourcechanger.pas
Assembling sourcechanger
Assembling customcodetool
Assembling pascalparsertool
Compiling eventcodetool.pas
Compiling methodjumptool.pas
Compiling stdcodetools.pas
Compiling finddeclarationtool.pas
Compiling definetemplates.pas
Assembling definetemplates
Compiling finddeclarationcache.pas
Assembling finddeclarationcache
Assembling finddeclarationtool
Assembling stdcodetools
Assembling methodjumptool
Assembling eventcodetool
codecompletiontool.pas(881,29) Error: Method (variable) and Procedure (variable) are not compatible
codecompletiontool.pas(881,29) Error: Method (variable) and Procedure (variable) are not compatible
codecompletiontool.pas(1297) Fatal: There were 2 errors compiling module, stopping


But the the line is absolutely correct. Because if I repeat the compile, I get:

[mattias at limoooh codetools]$ ppc386 allcodetoolunits.pp 
Free Pascal Compiler version 1.0.5 [2002/02/25] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling allcodetoolunits.pp
Compiling codetoolmanager.pas
Compiling codecompletiontool.pas
Assembling codecompletiontool
Assembling codetoolmanager
2923 Lines compiled, 0.8 sec


I tried the -vb option, but the compiler does not show anything.

The line (881) is the following:

ClassProcs.OnCompare:=@CompareCodeTreeNodeExtWithPos;

where ClassProcs.OnCompare is

    property OnCompare: TListSortCompare read FOnCompare write SetOnCompare;

and CompareCodeTreeNodeExtWithPos is

function CompareCodeTreeNodeExtWithPos(NodeData1, NodeData2: pointer): integer;


I have committed the code to lazarus cvs, since everything seems to be correct, but the strange compiler bug.

The same bug also appears in uniteditor.pp (in the lazarus main dir) five times.

Any help is greatly appreciated.

Mattias Gaertner




More information about the fpc-pascal mailing list