Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!rsiatl!stan From: stan@Dixie.Com (Stan Brown) Newsgroups: comp.lang.c Subject: Re: External Functions Message-ID: <8298@rsiatl.Dixie.Com> Date: 17 Mar 91 14:34:19 GMT References: <8146@rsiatl.Dixie.Com> <1991Mar16.125116.5560@cc.helsinki.fi> Organization: Dixie Communications Services Lines: 27 wirzenius@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"