[Coco] Re: creatdsk.c source

Mannequin* mannslists at invigorated.org
Sat Dec 24 13:29:36 EST 2005


tim lindner wrote:
> Mannequin* <mannslists at invigorated.org> wrote:

>>In Microware C, you didn't have to include string.h when you used the
>>string manipulation functions? Wouldn't that have added to the
>>executables size with those (and other) functions compiled in and not
>>being used?
>>
>>Anyone want to explain this for me?
> 
> Header files don't add to the executable size becuse they (usually)
> don't include any executable code. They usually only include
> declarations. Sometime they can include static data, but it is usually
> tiny. string.h doesn't contain any static data.
>
> Only calling functions defined in a header file will cause the linker to
> add the code that implements the function.

I knew that they only contained prototypes and declarations, etc. But
what I was confused about was what the linker did with that information.
I guess I forgot that it only adds the code that you use, because I was
under the impression that it included the whole library.

Thanks for the clarification. :)
-M.



More information about the Coco mailing list