[fpc-pascal] Optimizing code generation fpc (lazarus)?

Bo Berglund bo.berglund at gmail.com
Sun May 17 11:15:17 CEST 2020

Maybe a stupid question, but...

I am struggling with porting a Windows service application written
with D7/D2007 back in 2004-2006 or so. I need to get it moved to Linux
because of Windows 10 issues.

Now I am handling a lot of errors from a "CommonFuncs" unit that is
used in many different applications including this one. It contains a
whole lot of functions that all work fine in Windows from Delphi.
Looks like it is a unit that has collected a lot of very special
functions over the years...

When compiling from Lazarus I get a lot of errors thrown from
functions not used by the application I am porting....

So now I wonder if there is a way to compile the application where the
compiler will not touch functions that are not used in the current

As it is now I am slooowly working my way through a mass of functions
that are not used in order to ifdef away parts of the code and finding
FPC equivalents for others.
But it would be so much easier if the compiler could disregard
functions that are not called in the project and therefore not try to
compile them at all.

Or is this impossible due to the way the compile/linking is working?

Bo Berglund
Developer in Sweden

More information about the fpc-pascal mailing list