[Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

dmitry boyarintsev skalogryz.lists at gmail.com
Fri Apr 10 12:22:06 CEST 2009


Can compiler detect, if initialized procedure variable is not used and
smartlink it off?
In the following example:
there's a global procedure variable. it's initialized by unit2, that
is used by program.
but even if it's initialized, the procedure itself (someProc) is never called.
So, is it possible to cut off someProc and MyProc as well?


--- unit1.pas ---

interface

var
  someProc : TProcedure;

--- unit2.pas ----

uses
  unit1;

procedure MyProc;

initialization
  someProc := @MyProc;

--- program.pas

uses
  unit1, unit2;

begin
  writeln('hello world');
end.

thanks,
dmitry



More information about the Lazarus mailing list