Article View: comp.std.c
Article #5340Re: C function prototyping and large projects
From: Dale Gass
Date: Sat, 17 Sep 1988 19:03
Date: Sat, 17 Sep 1988 19:03
24 lines
1709 bytes
1709 bytes
My personal preference when using prototypes, is to put all the prototypes
into one header file (proto.h, or whatever), which is included by all modules
in the project; however, I don't declare the dependency of all the source
files upon proto.h.
This avoids having to recompile *all* the modules whenever you simply add
the prototype of a new function to proto.h. It could prove dangerous if
you *change* the syntax of the prototype in proto.h carelessly; whenver
you change a syntax in proto.h, you should 'touch *.c' to remake all
modules. But I find in development, the ability to quickly add to proto.h
without having to recompile everything is a major time-saver.
For maintenance work on a large project, I would probably declare the
make dependency of the source files on proto.h, since modification of proto.h
(when you change the syntax of a prototyped function) could be dangerous
to existing modules (which won't be recompiled). Howeven, when one changes
the syntax of a function, he should go through all his souces modules and
change all the references to it, anyway (in which case, those modules will
be recompiled and prototype-checked against proto.h)...
--------------
-dalegass@dalcsug
{watmath|uunet}!dalcs!dalcsug!dalegass
Technical Details
Message-ID:
<105@dalcsug.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!dalcs!dalcsug!dalegassReferences:
<24@motto.UUCP> <3511@boulder.Colorado.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!dalcs!dalcsug!dalegass From: dalegass@dalcsug.UUCP (Dale Gass) Newsgroups: comp.std.c,comp.lang.c Subject: Re: C function prototyping and large projects Message-ID: <105@dalcsug.UUCP> Date: 17 Sep 88 19:03:15 GMT References: <24@motto.UUCP> <3511@boulder.Colorado.EDU> Reply-To: dalegass@dalcsug.UUCP (Dale Gass) Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada Lines: 24