C function prototyping and large projects

Clayton Cramer cramer at optilink.UUCP
Tue Oct 4 04:24:45 AEST 1988


In article <8597 at smoke.ARPA>, gwyn at smoke.ARPA (Doug Gwyn ) writes:
> In article <435 at thirdi.UUCP> peter at thirdi.UUCP (Peter Rowell) writes:
> >Minor Flame:  I do *not* understand why people seem to feel that there
> >is some moral benefit to manual maintenance of information that is
> >trivially kept correct by automatic means.  If it is OK for the compiler
> >to "automatically" check these things, what is wrong with creating them
> >automatically?
> 
> In the specific case of function prototypes, if you are following
> recommended software engineering procedure, your specification for
> function interfaces precedes writing the code to implement (or use)
> them.  Automatic generation of prototypes goes in exactly the wrong
> direction.

Amazing, though, how often the function interfaces change after you
start debugging -- and how easy it is to forget to add new function
prototypes when you add new functions.

The compiler will catch the mismatches of prototypes when you change
an existing function specification, but it's still darn annoying to
realize you need to make the change after 20 modules have recompiled,
and you have to recompile them again.

It's a bit of a nuisance setting up the make files to do it (at least
with Microsoft C), but automatic generation of function prototypes
is the only way to go.
-- 
Clayton E. Cramer
..!ames!pyramid!kontron!optilin!cramer



More information about the Comp.lang.c mailing list