From owner-freebsd-current Sat Feb 1 16:51:39 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3FE7E37B431 for ; Sat, 1 Feb 2003 16:51:34 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B114343F3F for ; Sat, 1 Feb 2003 16:51:33 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.6/8.12.6) with ESMTP id h120pXSJ018366; Sat, 1 Feb 2003 16:51:33 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.6/8.12.6/Submit) id h120pXMI018365; Sat, 1 Feb 2003 16:51:33 -0800 (PST) Date: Sat, 1 Feb 2003 16:51:33 -0800 (PST) From: Matthew Dillon Message-Id: <200302020051.h120pXMI018365@apollo.backplane.com> To: Mark Murray Cc: current@FreeBSD.ORG Subject: Re: Style fixups for proc.h References: <200302020036.h120ajaX040534@grimreaper.grondar.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> I really dislike screwing around with source code to work around :> bugs in the the compiler, or lint. Given the choice of underlines :> or leaving the arguments unnamed, I would leave them unnamed. Or I :> would figure out and remove whatever broken compiler option is generating :> the warning in the first place. : :Then can we just get the proc.h prototypes into a (any) consistent :style? : :M :-- :Mark Murray Lets ask ourselves what the goal of the named prototypes is... the compiler doesn't need them, obviously, so one would presume that the goal is human readability. So if we care about human readability we should simply name them after the argument names used in the procedures proper. If we don't care about human readability we should omit the names entirely. An underscore would be detrimental to human readability. It makes the prototypes look rather nasty when I look at the fully patched proc.h, and also makes them different from the arguments as declared in the procedures proper. A quick perusal of include files shows that we use a mix. Examples: sys/acl.h -- looks like the authors tried to use the underscore technique but forgot a couple. sys/aio.h -- a mix of named (without underscore) and unnamed. sys/blist.h -- named prototypes without underscore (mine originally) sys/buf.h -- a mix of named (without underscore) and unnamed. Mostly unnamed, and __P() is still being used. (the named one is probably mine). sys/callout.h -- unnamed. sys/conf.h -- mostly named (without underscore) (not mine) sys/cons.h -- unnamed And it goes on. Quite a mess we have, actually. We still have __P in many places. The newest header file would arguably be acl.h in which the author used underscores. I can't say I like the way it reads on the screen. Older header files either still have __P, don't have __P and the arguments are named (typically without an underscore), or mix with some of the arguments named and some not (some wholely not). -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message