Hi Eric,

No, I didn't try to optimize the code by removing printf() and friends. 
It's not such a big deal in fact - with Turbo C my code computed a 
binary of ~13K, and with OW it is more like ~21K. Both compile a real 
mode, 16bit binary. I was just expecting that a modern compiler like OW 
would make more compact binaries than the 1988 Turbo C, but I guess that 
it's simply because Watcom's libc have more stuff in it, and it 
(probably?) don't perform any dead code elimination inside units..

But you're right of course, I will take a look at the options used by FD 
kernel, maybe I missed the -enable-small-binaries switch I was looking 
for :)

cheers,
Mateusz



On 07/26/2014 02:36 PM, Eric Auer wrote:
>
> Hi!
>
>> I'm quite surprised to notice that on average, the binaries produced by
>> OW are twice as big as the same code compiled using Turbo C.
>
> Have you tried the usual stuff, such as avoiding heavier
> constructs like file streams and printf formatters? There
> might be some lighter alternative C libraries for OW as
> well, but I remember that the FreeDOS kernel size is not
> bad with OW - have a look at which compile switches that
> uses and which library functions it avoids ;-) Note that
> 16 vs 32 bit compile may make a big difference.
>
> Cheers, Eric

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to