Xref: utzoo comp.lang.c:8475 comp.sys.ibm.pc:13578 Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: C declaration styles Message-ID: <10062@steinmetz.steinmetz.ge.com> Date: 23 Mar 88 14:52:19 GMT References: <5699@watdragon.waterloo.edu> <1065@sask.UUCP> <8695@tut.cis.ohio-state.edu> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 24 In article <8695@tut.cis.ohio-state.edu> mdf@tut.cis.ohio-state.edu.UUCP (Mark D. Freeman) writes: | Another great idea: make your declarations look like this... | | void foo(int x, double y) /* DECLARATION */ | | and you can create quick and dirty documentation for yourself with one | grep piped through sort, resulting in an alphabetized list of all your | functions showing the number and types of arguments for each! Great | for libraries that you are writing. A very good idea. Here are two things to look for in MSC: 1) you can just use the -Zg option which will create the type of documentation you want (almost) without the names of the args. This file may then be included in all modules, giving type coersion to all calls, and type checking on the returns. I use this in several packages, and it works well. 2) I have a note saying that there may be a problem when using float, in that "float x" expects a float as the argument, while "foo(x) float x; {" expects a double (as per K&R). -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me