Date: Sat, 1 Feb 2003 16:51:33 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Mark Murray <mark@grondar.org> Cc: current@FreeBSD.ORG Subject: Re: Style fixups for proc.h Message-ID: <200302020051.h120pXMI018365@apollo.backplane.com> References: <200302020036.h120ajaX040534@grimreaper.grondar.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:> 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
<dillon@backplane.com>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302020051.h120pXMI018365>
