ANSI C prototypes

Dan Salomon salomon at ccu.umanitoba.ca
Sat Nov 3 23:24:32 AEST 1990


In article <MKU65ZE at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>In article <1990Nov2.030556.27759 at ccu.umanitoba.ca> salomon at ccu.umanitoba.ca (Dan Salomon) writes:
>> You are both right.  Repeatedly typing function prototypes is a tedious
>> waste of time, but we really would like type errors reported at compile
>> time.
>> A possible solution would be to have a utility for building libraries
>> of function prototypes from source code.
>
>Ever hear of include files?
>

Actually, include files aren't quite the same as a library of function
prototypes.  The distinction is the same as between an object library,
and a file full of object modules.  In addition to the problem of
keeping the include files up to date,  there is also the problem of
filling up your symbol table with dozens of unused symbols.
Processing all the prototypes in an include file is slower than a search
for and processing of only the ones actually needed.

This is especially a problem when a large collection of functions are
grouped together in a common directory, but in separate files.  Such an
organization speeds up the compilation of large projects, by allowing
the recompilation of only the out-of-date functions.  If each of the
files has to include a large number of prototypes, the some of the
speed up is lost.

Once your set of functions is running, what tool do you use to assemble
all the prototypes into up-to-date include files?  Such tools exists for
object modules, perhaps similar tools are needed for function
prototypes.
-- 

Dan Salomon -- salomon at ccu.UManitoba.CA
               Dept. of Computer Science / University of Manitoba
	       Winnipeg, Manitoba, Canada  R3T 2N2 / (204) 275-6682



More information about the Comp.lang.c mailing list