From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <9ab217670604170900o62544233r59b8a9a504a656f6@mail.gmail.com> Date: Mon, 17 Apr 2006 09:00:33 -0700 From: "Devon H. O'Dell" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Function args not checked In-Reply-To: <4443BA0C.3020300@comtv.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <40e76fd4ab1b047841b5829ed8015b0e@plan9.bell-labs.com> <4443BA0C.3020300@comtv.ru> Topicbox-Message-UUID: 3822cc7c-ead1-11e9-9d60-3106f5b1d025 2006/4/17, Victor Nazarov : > jmk@plan9.bell-labs.com wrote: > > >As an aside, when you declare prototypes I find it is best to > >only give the types of the parameters and not declare identifiers, > >e.g. > > extern Elem mkoid(Ints *); // asn1.h > >rather than > > extern Elem mkoid(Ints *oid); // asn1.h > >This prevents confusion in environments where there is overuse > >of the pre-processor and the identifier gets substituted. > > > > > It's just an evidence of preprocessor's danger. Let's use enums. IMHO, > prototypes are quite good documentation sometimes. Until someone reorders arguments and forgets to update the prototype to reflect them. Using argument names in your prototypes is not an excuse to not write documentation on your API. It is an excuse to be lazy. --Devon > -- > Victor Nazarov > >