Date: Tue, 30 Jul 2013 12:02:07 -0700 From: "David O'Brien" <obrien@FreeBSD.org> To: John Baldwin <jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r253618 - head/sys/dev/usb/gadget Message-ID: <20130730190207.GC63635@dragon.NUXI.org> In-Reply-To: <201307241529.35175.jhb@freebsd.org> References: <201307241832.r6OIWFGc074918@svn.freebsd.org> <201307241529.35175.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 24, 2013 at 03:29:34PM -0400, John Baldwin wrote:
> On Wednesday, July 24, 2013 2:32:15 pm David E. O'Brien wrote:
> > 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.
Hi John,
As BDE mentioned, the text [still] says it is OK to depend on
<sys/types.h> and <sys/param.h> including <sys/cdefs.h>.
I was one of the ones that put __FBSDID() in much of our code. I used
a script to add the two lines:
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
I did it this way so as to not break the "but not both" rule for
<sys/types.h> and <sys/param.h>. In otherwords my script wasn't
smart enough to see if <sys/param.h> or <sys/types.h> was already
being included and put the '__FBSDID("$FreeBSD$");' right below it.
I don't feel
#include <sys/param.h>
__FBSDID("$FreeBSD$");
#include <sys/___.h>
is against style(9).
Should explicit language be added that one of <sys/types.h>,
<sys/param.h>, or <sys/cdefs.h> should be included first
followed by '__FBSDID("$FreeBSD$");' (when used). Followed
by all other headers.
--
-- David (obrien@FreeBSD.org)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130730190207.GC63635>
