Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!apple!amdahl!lamont From: lamont@uts.amdahl.com (Duane Richard LaMont) Newsgroups: comp.lang.c Subject: Re: lint (was: Funny mistake) Message-ID: Date: 28 Mar 91 04:22:06 GMT References: <5036@goanna.cs.rmit.oz.au> <13627@helios.TAMU.EDU> <1991Mar23.043408.5260@athena.mit.edu> <1991Mar24.165719.26908@druid.uucp> Reply-To: lamont@amdahl.uts.amdahl.com (Duane Richard LaMont) Organization: Amdahl Corporation, Sunnyvale CA Lines: 23 In article <1991Mar24.165719.26908@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes: >Just a side note here. I hardly ever prototype static functions. I >simply make sure that within a file a function is not used until it >has been defined. This in effect makes it a prototype for itself. I thought this was a good idea too, but it didn't work for me on the first prototyping compiler I ever used (SCO XENIX, forget the version number). It behaved as if I had declared the function without prototyping it (i.e. the return type was known, but not the argument count and types). So I got in the habit of prototyping static functions and haven't tried the "self prototyping" method since. One advantage of prototyping everything is that I'm free to put the functions in the order I'm most comfortable with. Of course, this discussion wouldn't be complete without mentioning mutual recursion. I'm sure that's one case where Mr. Cain does prototype static functions (note he didn't say "never" :-). Are prototyping compilers supposed to treat a function as prototyped following that function's definition? Rick LaMont