Mail Archives: djgpp/1997/01/04/12:38:04
>
> If I start of with a program such as this:
>
> /**test.c***********/
>
> void main(void)
> {
> int i;
> for (i=0; i<5; i++); /* do-nothing */
> }
>
> /*******************/
>
> and compile it like this:
>
> gcc test.c -o without
>
> Then I add one function (to reposition cursor), like this:
>
> /**test.c***********/
>
> #include <conio.h>
>
> void main(void)
> {
> int i;
>
> for (i=0; i<5; i++); /* do-nothing */
> gotoxy(1,1);
> }
>
> /*******************/
>
> and use the following compile sequence,
>
> gcc test.c -o with
>
> Now, it I compare the file sizes of with.exe and without.exe,
>
> 1-04-97 22:46 100,205 with.exe
> 1-04-97 22:47 61,446 without.exe
>
>
> POINT!!!: Why does the addition of gotoxy(1,1) add 40k of code the the
> size of the executable?? In assembler such an addition would be about 10
> bytes!
Do you mean a DOS int that is doing a gotoxy() ? Since gotoxy is a
C library function (I assume) it's code is linked to your executable
and thus grows the executable accordingly. If you knew the asm
code for this you might #define gotoxy as an inline asm code
and keep your executable small.
>
> How can I stop the whole conio (I assume) library from being linked in????
>
> Thankyou.
>
> Matthew
>
>
>
--Chris Christoph P. U. Kukulies kuku AT gil DOT physik DOT rwth-aachen DOT de
- Raw text -