community.borland.com

Article #15667: LINKER ELIMINATES UNUSED DATA

 Technical Notes Database

TN667D.txt   LINKER ELIMINATES UNUSED DATA
Category   :Pascal
Platform    :All
Product    :Turbo Pascal  5.0 5.5

Description:
Q. Does the built-in linker eliminate unused data?
A. Yes. Unused code AND data are stripped when you compile to
   disk.  However, if more than one variable is defined in the
   same VAR block and any one is used, the others will not be
   stripped from the .EXE.  For example:

     var  A, B: integer;
     var  C: integer;
     begin
       A:= 0;
     end.

  In this example, although variable B is never used, it was
  defined in the same block as a variable A. Therefore, B will
  not be linked out.  Variable C will be removed from the .EXE as
  it is not used and is not in the same VAR block.


Reference:


7/16/98 4:35:34 PM
 

Last Modified: 01-SEP-99