svn commit: r305998 - in head/usr.bin: cmp indent tr

Warner Losh imp at bsdimp.com
Tue Sep 20 04:08:45 UTC 2016


If you read style(9) as an annotated example of best practices, you'll
see that it is actually documented there, but poorly. It's the first
one after cdefs for the FreeBSD ID. It says to include one or the
other, with the implication it's first. It's the common interpretation
of the project (this issue has come up before) and it's just one tiny
sliver of tribal knowledge that was attempted to be enshrined there.

Yes, it isn't explicit, but it matches convention in the rest of the
tree. Maybe it should be explicit, but it's always a shit-show when
people tinker with style(9) to make it "clearer" because other people
think you did it wrong, or need to list a big set of exceptions to the
rule or who knows what. Hell, I couldn't even add that {} were allowed
in contexts where people had been using them for a decade without it
being a stupid bikeshed and despite extremely careful vetting and
consensus building I have been told that one committer left the
project over it.

So I'd think twice about modifying style.9 and go have a beer or your
favorite relaxing beverage instead.

Warner

On Mon, Sep 19, 2016 at 3:03 PM, Conrad Meyer <cem at freebsd.org> wrote:
> If you re-read the sentences you've pasted carefully, I think you'll
> find it doesn't actually say that the types or param headers come
> before other sys/ headers.  Just that sys/ headers come before
> non-sys/ headers.
>
> Best,
> Conrad
>
> On Mon, Sep 19, 2016 at 1:45 PM, Ngie Cooper (yaneurabeya)
> <yaneurabeya at gmail.com> wrote:
>>
>> On Sep 19, 2016, at 1:43 PM, Conrad E. Meyer <cem at FreeBSD.org> wrote:
>>
>> Author: cem
>> Date: Mon Sep 19 20:43:03 2016
>> New Revision: 305998
>> URL: https://svnweb.freebsd.org/changeset/base/305998
>>
>> Log:
>>  Move sys/capsicum.h includes after types.h or param.h
>>
>>  This is not actually documented or even implied in style(9).  Make the
>> change
>>  to match convention.  Someone should document this convention in style(9).
>>
>>  Reported by: jhb
>>  Sponsored by: EMC Dell Isilon
>>
>>
>> Uh… yes it clearly states it in style(9). From
>> https://www.freebsd.org/cgi/man.cgi?query=style&sektion=9 :
>>
>>      Kernel include files (i.e. sys/*.h) come first; normally, include
>>      <sys/types.h> OR <sys/param.h>, but not both.  <sys/types.h> includes
>>      <sys/cdefs.h>, and it is okay to depend on that.
>>
>> Thanks,
>> -Ngie
>


More information about the svn-src-all mailing list