patch to style(9) man page to reflect current practices
Chris Pressey
cpressey at catseye.mine.nu
Wed Feb 18 13:52:28 PST 2004
On Thu, 5 Feb 2004 12:16:48 -0800
Chris Pressey <cpressey at xxxxxxxxxxxxxxx> wrote:
> On Thu, 5 Feb 2004 19:22:50 +0100
> Joerg Sonnenberger <joerg at xxxxxxxxxxxxxxxxx> wrote:
>
> > On Thu, Feb 05, 2004 at 10:18:58AM -0800, Chris Pressey wrote:
> > > There was one other change I wanted to make, re:
> > >
> > > "In header files visible to userland applications, prototypes that
> > > are visible must use either ``protected'' names (ones beginning
> > > with an underscore) or no names with the types. It is preferable
> > > to use pro- tected names. E.g., use:
> > > void function(int);
> > > or:
> > > void function(int _fd);"
> >
> > Well, I say simple drop the name.
> >
> > > I completely fail to see the rationale for that, but I might be
> > > missing something. Also, I don't think I've ever seen prototype
> > > declarations like that, but I probably just haven't been looking
> > > hard enough.
> >
> > You might have a #define fd foo somewhere.
>
> Ah.
>
> Well, I count about 470 occurances of the form #define _foo in the
> source tree (more if you count _FOO and __foo and __FOO,) and there's
> nothing in style(9) that I can see that forbids definining macros with
> a leading underscore. So I'm inclined to agree with you about just
> dropping the name.
>
> -Chris
Recently on FreeBSD's cvs list a compromise was suggested, by juli I
think, that declarations in (non-kernel-only) header files should look
like:
void function(int /* fd */, char /* foo */);
I think I agree, and if there aren't any objections, I can start working
on patches to the headers and to style(9) to work towards that.
-Chris
More information about the Submit
mailing list