From owner-freebsd-arch Wed Oct 3 1:24:22 2001 Delivered-To: freebsd-arch@freebsd.org Received: from arb.arb.za.net (arb.arb.za.net [196.7.148.4]) by hub.freebsd.org (Postfix) with ESMTP id 6B23E37B401; Wed, 3 Oct 2001 01:24:14 -0700 (PDT) Received: (from uucp@localhost) by arb.arb.za.net (8.11.3/8.11.3) with UUCP id f938OBC84859; Wed, 3 Oct 2001 10:24:11 +0200 (SAST) (envelope-from mark@grondar.za) Received: from grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.11.6/8.11.6) with ESMTP id f938KvA47987; Wed, 3 Oct 2001 09:20:58 +0100 (BST) (envelope-from mark@grondar.za) Message-Id: <200110030820.f938KvA47987@grimreaper.grondar.za> To: Mike Smith Cc: arch@freebsd.org From: mark@freebsd.org Subject: Re: [Patch] style.9 nit References: <200110022325.f92NPSt02665@mass.dis.org> In-Reply-To: <200110022325.f92NPSt02665@mass.dis.org> ; from Mike Smith "Tue, 02 Oct 2001 16:25:28 PDT." Date: Wed, 03 Oct 2001 09:20:56 +0100 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > 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. Ok - I like the protected name approach (int foo (int _bar) instead of int foo(int bar) ). Does that work for you? The namespace pollution I refer to is WARNS=2 complaints about variable "bar" overriding a global/previous definition. > 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. I'd like to protect the argument names in header files that are causing WARNS=2 breakage. M > > 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 > > -- o Mark Murray \_ FreeBSD Services Limited O.\_ Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message