Date: Tue, 02 Oct 2001 16:25:28 -0700 From: Mike Smith <msmith@freebsd.org> To: Mark Murray <mark@grondar.za> Cc: arch@freebsd.org Subject: Re: [Patch] style.9 nit Message-ID: <200110022325.f92NPSt02665@mass.dis.org> In-Reply-To: Your message of "Mon, 01 Oct 2001 17:48:42 BST." <200110011648.f91Gmgt25779@grimreaper.grondar.za>
next in thread | previous in thread | raw e-mail | index | archive | help
> Hi > > Any objections to this patch? > > It removes argument names from an example function prototype > to match a previously mentioned guideline about such names. This is a bit of a contentious issue. Personally, I find it useful to be able to tell what the argument(s) to a function are from the prototype. All this really saves us from would be, in your example, someone redefining 'bar' with a preprocessor macro; something they typically shouldn't be doing anyway (based on other guidelines). For documented functions that are part of a public interface and consumed by third-party code, I think this is a good idea. For other code, I'm less sure about it. > eg: > > int foo(int bar); > > becomes > > int foo(int); > > This helps quite a bit in reducing namespace pollution. > > M > > Index: style.9 > =================================================================== > RCS file: /home/ncvs/src/share/man/man9/style.9,v > retrieving revision 1.66 > diff -u -d -r1.66 style.9 > --- style.9 1 Oct 2001 16:13:59 -0000 1.66 > +++ style.9 1 Oct 2001 16:39:38 -0000 > @@ -252,8 +252,7 @@ > Prototypes may have an extra space after a tab to enable function names > to line up: > .Bd -literal > -static char *function(int _arg, const char *_arg2, struct foo *_arg3, > - struct bar *_arg4); > +static char *function(int, const char *, struct foo *, struct bar *); > static void usage(void); > > /* > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110022325.f92NPSt02665>