svn commit: r253618 - head/sys/dev/usb/gadget

Bruce Evans brde at optusnet.com.au
Thu Jul 25 16:59:20 UTC 2013


On Wed, 24 Jul 2013, John Baldwin wrote:

> On Wednesday, July 24, 2013 2:32:15 pm David E. O'Brien wrote:
>> Author: obrien
>> Date: Wed Jul 24 18:32:15 2013
>> New Revision: 253618
>> URL: http://svnweb.freebsd.org/changeset/base/253618
>>
>> Log:
>>   per style(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.
>
> This is not fully correct.  The consistent style throughout the tree when
> using _FBSDID() is:
>
> #include <sys/cdefs.h>
> __FBSDID()
>
> #include <sys/param.h>
> ...
>
> Please fix these to match that.  It might not be a bad idea to document the
> __FBSDID() practice in style.9 while you are at it.

This ugliness (sys/cdefs.h before __FBSDID()) is to avoid changing all the
includes of sys/param.h and sys/types.h or even anyother.h that followed
the old style rule.

As is common, style(9) documents the rule for sys/cdefs.h before
__FBSDID() only by example.  Its main text wasn't changed and still
emphasizes depending on getting sys/cdefs.h from sys/param.h or
sys/types.h and not from anywhere else.  But almost everywhere else
now includes it too, and with it included before __FBSDID(), almost
all direct includes of it not before __FBSDID() are style bugs.

Bruce


More information about the svn-src-head mailing list