Mail Archives: djgpp/2000/11/11/20:45:12
On Sat, 11 Nov 2000 16:41:10 -0500, Julian Hsiao <madoka AT novastar DOT com>
wrote:
>I'm currently taking a programming class and being short on budget, uses
>DJGPP and Borland's free compiler and XEmacs for assignments. The
>reason I uses both compilers is because I try to avoid using certain
>constructs that only GCC or Borland provides (well, I guess the only way
>to completely avoid that is to code while reading the C++ specs paper,
>but I'll pass on that...).
>
>Either one worked quite well for my purpose (except for some reason,
>violating the const declaration only results in a warning in both
>compilers, but an error in CW, which is what my class uses)
I treat warnings (except "this variable is unused") as errors.
>but I noticed that DJGPP's generated binary size is considerably larger
>than that of Borland compiler. With DJGPP, I pretty much always get
>~200K binaries while with Borland's compiler I get ~40K binaries.
A DJGPP 200K binary includes:
o code to go into and out of protected mode
o code to "glob" filenames passed on the command line
o parts of DJGPP libc, which is large because it has to call DOS
services through DPMI, it's nearly POSIX compliant, and it's
optimized for speed (DOS calls through DPMI are _really_ expensive)
o your code, using 32-bit constants
o debugging information, which can be removed with strip.exe from
djdev203.zip
A Borland 40K binary includes:
o a much smaller libc, optimized for size
o your code, using 16-bit constants
o debugging information (unless you've turned it off)
Both kinds of exe can be made smaller with UPX:
http://upx.tsx.org/
But why are you concerned about exe size anyway? Do you have to fit
several binaries onto a single floppy? If so, avoid duplicating libc
by combining several programs' function into one program.
--
<O
( \ GNOME vs. KDE: the game!
X http://pineight.8m.com/nes.htm
This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses. http://www.mcafee.com/
- Raw text -