[fpc-devel] Re: FPC unit symbol checksum woes

Adriaan van Os fpc at microbizz.nl
Wed Sep 3 14:21:19 CEST 2008


Adriaan van Os wrote:
> Peter Vreman wrote:

> Thanks for the hint. I managed to rebuild the compiler with -dINTFPPU 
> and this does produce .ppu.intf files when compiling with it. The diff 
> between the ppudump of the the .ppu files and the .ppu.intf files does 
> show checksum and other differences. Not sure which ones to look at.

I think, I solved the checksum mystery. It is related to what Jonas wrote on the macpascal mailing 
list:

> The two main reasons I know of that currently can change the interface crc are
> a) calls to inline functions of which only the interface was parsed when the function was called
> b) calls to functions which are declared as regular functions in the interface of a unit, but as external functions in the implementation

The tricky part is that fpc in macpas mode implicitely assumes that (b) happens if a procedure or 
function is declared in the interface part but not implemented in the implementation part ! Neither 
is - as far as I know - a warning issued by fpc in this situation, as CodeWarrior does !

For example, for a test program checksumwoes.pas:

{$mode macpas}
unit checksumwoes;
interface
procedure Forgotten;
implementation
end.

the ppudump of checksumwoes.ppu.intf reads:


PPU-Analyser Version 2.3.1
Copyright (c) 1998-2007 by the Free Pascal Development Team

Analyzing checksumwoes.ppu.intf (v91)

Header
-------
Compiler version        : 2.3.1
Target processor        : i386
Target operating system : Darwin-i386
Unit flags              : little_endian
FileSize (w/o header)   : 519
Checksum                : EE8A133F
Interface Checksum      : 2BCCD624
Definitions stored      : 0
Symbols stored          : 0


whereas the ppudump of checksumwoes.ppu reads:


PPU-Analyser Version 2.3.1
Copyright (c) 1998-2007 by the Free Pascal Development Team

Analyzing checksumwoes.ppu (v91)

Header
-------
Compiler version        : 2.3.1
Target processor        : i386
Target operating system : Darwin-i386
Unit flags              : static_linked, little_endian, local_threadvars, local_symtable
FileSize (w/o header)   : 1002
Checksum                : 33531017
Interface Checksum      : 39ACE269
Definitions stored      : 2
Symbols stored          : 12


I haven't checked if this solves (or works around) the compiler crash. A "not implemented" warning 
in macpas mode would be helpful !

Regards,




More information about the fpc-devel mailing list