svn commit: r286168 - head/sys/net

John-Mark Gurney jmg at funkthat.com
Sun Aug 2 04:34:04 UTC 2015


Bruce Evans wrote this message on Sun, Aug 02, 2015 at 14:10 +1000:
> On Sun, 2 Aug 2015, John-Mark Gurney wrote:
> 
> > Log:
> >  convert to C11's _Static_assert, and pull in sys/cdefs.h for
> >  compatibility w/ older non-C11 compilers...
> 
> This include is bogus.  <net/pfkeyv2.h> already depends on the includer
> including other headers that include <sys/cdefs.h>.  Mainly <sys/types.h>.
> <sys/types.h> defined massive namespace pollution that includes everything
> in <sys/cdefs.h>.  It includes <sys/cdefs.h> an infinite number of times
> via recursion, except the recursion is stopped by anti-reinclude guards.
> Th recursion makes the static number of nested includes of <sys/cdefs.h>
> hard to count.

I'll test w/o sys/cdefs.h and if it compiles, I'll remove it...

> Also, this is a kernel header.  All kernel headers depend on the includer

Except it isn't just a kernel header as we found out, otherwise
CTASSERT would have been perfectly fine...  It defines an API between
kernel and userland for adding and changing the kernel SA/SP
database...  See sbin/setkey and lib/libipsec...

[comments about kernel only headers deleted]

> If an application wants to abuse a kernel header, then it must fake
> the kernel environment for it.  I don't know much about this header,
> but it is not documented in any man page so it can do anything.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the svn-src-head mailing list