Mail Archives: djgpp/1996/03/28/09:49:55
On Wed, 27 Mar 1996, bonni mierzejewska wrote:
> I'm too new to DOS to know why a programme compiled with a 32-bit compiler
> is always bigger than the same programme compiled with a 16-bit compiler.
First, don't forget to run `strip' on your program (or link with -s), or
else you get debugging info/symbols with the GCC executable. Second, I
think many 32-bit opcodes are longer than their 16-bit brethren. Third,
last time I checked BCC (16-bit) and GCC produced very similar sizes of
executables for a non-trivial program, the above gotchas notwithstanding
(I *did* remember to strip, though). Last, but not least, the DJGPP C
library is much more powerful than the one that comes with BCC. For
example, the DJGPP's `rename' function can move entire directories. This
functionality comes for a price of larger code, which every program gets
even if it doesn't need those features.
Oh, and don't use -O3 unless you absolutely need it (profile before you
decide): it bloats the executable but in most cases doesn't gain you
anything runtime-wise. In fact, in many cases I saw decrease in speed.
-O2 is more than enough in most cases.
- Raw text -