From owner-freebsd-arch Tue Oct 2 10:21:56 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id A7C9C37B407; Tue, 2 Oct 2001 10:21:53 -0700 (PDT) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f92HLOk139552; Tue, 2 Oct 2001 13:21:24 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20011002212531.O87836-100000@delplex.bde.org> References: <20011002212531.O87836-100000@delplex.bde.org> Date: Tue, 2 Oct 2001 13:21:21 -0400 To: Bruce Evans , Ruslan Ermilov From: Garance A Drosihn Subject: Re: [Patch] style.9 nit Cc: Mark Murray , Content-Type: text/plain; charset="us-ascii" ; format="flowed" 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 At 9:59 PM +1000 10/2/01, Bruce Evans wrote: > >My version of style.9 clarifies this a little: > >%%% >Index: style.9 >=================================================================== >RCS file: /home/ncvs/src/share/man/man9/style.9,v >retrieving revision 1.66 >diff -u -2 -r1.66 style.9 >--- style.9 1 Oct 2001 16:13:59 -0000 1.66 >+++ style.9 2 Oct 2001 10:59:56 -0000 >@@ -238,5 +293,7 @@ > .Pp > In header files visible to userland applications, prototypes that are >-visible must use either protected names or no names with the types. It >+visible must use either >+.Dq Li protected >+names (ones beginning with an underscore) or no names with the types. It > is preferable to use protected names. > E.g., use: >%%% This seems like a good clarification to make to the standard style(9). >The diff is actually a little different: > >> > -static char *function(int _arg, const char *_arg2, struct >>foo *_arg3, >> > - struct bar *_arg4); >> > +static char *function(int, const char *, struct foo *, >>struct bar *); > >Since the function is static, this example is bad for other reasons. >Namespace pollution is almost irrelevant. The function proper must have >certain arg names and those should normally not begin with an underscore >or shadow any more global names. The function prototype can use the >same names. For static routines (ones in a *.c source file), should any prototypes at the top of the file include the exact argument names, without the underscore? Are the protected names only advisable for prototypes in include files? -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message