External Functions
Stan Brown
stan at Dixie.Com
Mon Mar 18 00:34:19 AEST 1991
wirzenius at cc.helsinki.fi (Lars Wirzenius) writes:
>(1) is better, since the declaration needs to be written only once, so
>there is less of a chance to introduce bugs when (not if) you change the
>function declaration. You could improve on (1) by putting its
>declaration (prototype if you have an ANSI compiler) into a header file,
>and #including that into any source file that calls foo, and also into
>the file that defines it (this is a handy way to ensure that
>declarations and definitions stay in sync).
Makes sense to me. But it raises the next logical question.
If We put it in a .h file should we have one of these for eache
source file that contains calls to externaly defined functions?
Or should we put all the external functions into say exter,h
and imclude this everywhere. Obviously if we do this
make will want't to recompile some things that really don't
need it every time we add a new function to extern.h
This is undesriable on my system because of slow complie times.
On the other hand if we have lots of include files we are back
to a maintenece headeache again.
--
Stan Brown P. c. Design 404-363-2303 Ataant Ga.
(emory|gatech|uunet) rsiatl!sdba!stan "vi forever"
More information about the Comp.lang.c
mailing list