TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Andrew Graham
from: Peter Fitzsimmons
date: 1995-01-05 06:23:14
subject: .exe size icc & link386

AG> I'm compiling a friend's ROT13 implementation here, which compiles to
 AG> 15K using Turbo C++ 3.0 (DOS), and the .exe is 35K using 
 AG> C Set++ FirstStep!

Keep in mind that the first is a 16bit compiler,  and the 2nd a 32bit
compiler (so even int's are twice as wide).

 AG> Can anyone suggest a way to trim .exe size using FirstStep?

Compile&link via icc with /Rn.


 AG> link386.exe statup.obj /NOE /PM:VIO,STARTUP.EXE;

Don't call link386 yourself -- let icc call it for you (this is actually
the fastest way to link,  since icc will use the in-memory copy of link386,
 whereas if you call it from the command line it will be reloaed);  icc
will also call the linker with several options which will cause the exe to
be smaller than what you have above.


 AG> int main()
 AG> {
 AG> return 0;
 AG> }

 icc /Rn test.c

For the above program is 3504 bytes.

The following program is 608 bytes!:

 // icc /Rn /O test.c /B"/noe"
 void _setuparg(void)       // not using argv
 {
 }

 void _setupenv(void)       // not using envp
 {
 }

 int main()
 {
     return 0;
 }




--- Maximus/2 2.01
* Origin: Sol 3/Toronto (905)858-8488 (1:259/414)
SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430
SEEN-BY: 711/807 808 809 934 942 949 712/353 515 713/888 800/1 7877/2809
@PATH: 259/414 400 99 250/99 3615/50 229/2 12/2442 711/409 808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.