3

Possible Duplicate:
How can I identify and get rid of unused units in the “uses clause” in Delphi 7?

is there a too that can check for unneeded uses units, that expand the project beyond its needs?

example we have

unit a; 

uses b,c;

procedure aP;
var bI:Tb;
begin
  bI := Tb.create;
  bI.free;
end;

end.

where there is no use of c. c was introduced to the project, and never being used at the project.

Community
  • 1
  • 1
none
  • 4,669
  • 14
  • 62
  • 102

1 Answers1

8

Yes, you can use the tool in CnPack or the one in Peganza.

Beware that even if you do not refer to a symbol defined in a unit, the inclusion of that unit can have an impact on your project. Including a unit means that code in any initialization or finalization sections runs and that can, of course, change the meaning of your program. The canonical example of this is a replacement memory manager.

The FAQ for GExperts discusses this issue and explains why they do not offer such a facility.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 1
    cnWizards by default will not un-use units which have initialization or finalization, this can be changed in the wizard dialog – mjn Sep 26 '11 at 11:26
  • 2
    OMG cnPack is legendary!!! thanks :D – none Sep 26 '11 at 12:12