Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ncar!noao!asuvax!stjhmc!p11.f15.n114.z1.fidonet.org!jim.nutt From: jim.nutt@p11.f15.n114.z1.fidonet.org (jim nutt) Newsgroups: comp.lang.c Subject: Re: C function prototyping and large projects Message-ID: <816.23499204@stjhmc.fidonet.org> Date: 4 Oct 88 09:14:18 GMT Sender: ufgate@stjhmc.fidonet.org (newsout1.24) Organization: FidoNet node 1:114/15.11 - St Joes Hospi, Phoenix AZ Lines: 41 > From: cramer@optilink.UUCP (Clayton Cramer) > Message-ID: <534@optilink.UUCP> > In article <8597@smoke.ARPA>, gwyn@smoke.ARPA (Doug Gwyn ) writes: > > In article <435@thirdi.UUCP> peter@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. there is a better way to do it if you have a decent editor... simply write a 'prototype macro'. then use the newstyle function declarations (if you can). all the prototype macro has to do is copy the function declaration to either a header or to the top of the file and add a semicolon to the end. instant prototype. better yet, just get into the habit of doing it yourself automatically. jim nutt 'the computer handyman' -- St. Joseph's Hospital/Medical Center - Usenet <=> FidoNet Gateway Uucp: ...{gatech,ames,rutgers}!ncar!noao!asuvax!stjhmc!15.11!jim.nutt