[fpc-devel] Random compiler errors

Sven Barth pascaldragon at googlemail.com
Sun Feb 10 21:55:09 CET 2013


On 10.02.2013 21:47, Adriaan van Os wrote:
> I maintain a large 600.000 FreePascal project that compiles for Mac OS
> X. It mixes MacPascal and Delphi compiler modes. Unfortunately the
> compiler is now producing random error messages, that disappear on a
> clean rebuild. The error messages are not clearly reproduceable.
> Sometimes, everything is OK, sometimes the incorrect error messages are
> there.
>
> I suspect corrupted .ppu files, I there a way to use a tool (like
> ppudump) or a specially built compiler to investigate this problem
> systematically, to get an idea of what is wrong ? I do builds through a
> Makefile. I could image always adding a ppudump to the builds and then
> looking at the output when random error messages popup, comparing the
> output to previous builds. Something like that.
>
> An automatic "ppu sanity mode" inside the compiler would even be better.

I suspect that is the same problem that one can sometimes experience 
when compiling the compiler from within an IDE (e.g. Lazarus). While I 
personally consider this a bug in the compiler (and I hope to fix this 
somewhen in the future) it might point to (complex) circular 
dependencies between units (involving more than two or three units) that 
are not cleanly detected. So one thing you could try is to check for 
complex circular dependencies in your code and try to resolve them (yes, 
I'm aware this is not that easy, but it's the only advice I can 
currently give you).

Regards,
Sven




More information about the fpc-devel mailing list