[fpc-devel] don't you thinkit'stime toupdatedelphimodecompatibility? - IDispatch, implements

Matthias Hryniszak matthias at hryniszak.de
Sun May 29 13:05:47 CEST 2005


----- Original Message ----- 
From: "Jamie McCracken" <jamie-junk at blueyonder.co.uk>
To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
Sent: Sunday, May 29, 2005 12:55 PM
Subject: Re: [fpc-devel] don't you thinkit'stime 
toupdatedelphimodecompatibility? - IDispatch, implements


> Daniƫl Mantione wrote:
>>
>> Op Sat, 29 May 2004, schreef Matthias Hryniszak:
>>
>> It *is* the source. The compiler is perfectly capapable of removing 
>> unused
>> code ust as well as the Delphi compiler. So, if you're pointing at the
>> compiler I assume you either have smartlinking disabled or that there is
>> debug information in the executable.

I don't get it. Let's try this example:

program Hello;
{$APPTYPE CONSOLE}
uses
  Classes, SysUtils;
procedure Test1(Param1: String; Param2: Integer; Param3: Char; Param4: 
Word);
var
  I: Integer;
  L: TList;
begin
  L := TList.Create;
  for I := 1 to 1000 do
    L.Add(Pointer(I));
  L.Free;
end;

begin
  Writeln('Hello, world!');
end.

Here you see a test procedure that's NOT called. with FPC 2.0 the executable 
file is 133120 long. Ok, let's turn this into the standard Hello, world! app 
and just leave the two useses be:

program Hello;
{$APPTYPE CONSOLE}
uses
  Classes, SysUtils;
begin
  Writeln('Hello, world!');
end.

And what do we have? 132608 executable. AFAIK 132608 is not the same as 
133120 so there MUST BE a problem with eliminating dead/unused code.

Matthias 





More information about the fpc-devel mailing list