From owner-svn-src-all@FreeBSD.ORG Mon Sep 6 13:45:22 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E25A10656C1; Mon, 6 Sep 2010 13:45:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id AAD1A8FC08; Mon, 6 Sep 2010 13:45:21 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o86DjI8l022156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Sep 2010 23:45:19 +1000 Date: Mon, 6 Sep 2010 23:45:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: pluknet In-Reply-To: Message-ID: <20100906234057.O954@delplex.bde.org> References: <201009031723.o83HNR7k056625@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-78721968-1283780718=:954" Cc: svn-src-head@FreeBSD.org, Matthew D Fleming , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212182 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2010 13:45:22 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-78721968-1283780718=:954 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 3 Sep 2010, pluknet wrote: > On 3 September 2010 21:23, Matthew D Fleming wrote: >> Log: >> =A0Fix user-space libsbuf build. =A0Why isn't CTASSERT available to >> =A0user-space? Well, user headers shouldn't be enlisted to check for kernel bugs that can be checked well enough in the kernel. >> Modified: >> =A0head/sys/kern/subr_sbuf.c >> >> Modified: head/sys/kern/subr_sbuf.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/subr_sbuf.c =A0 Fri Sep =A03 16:12:39 2010 =A0 =A0 =A0= =A0(r212181) >> +++ head/sys/kern/subr_sbuf.c =A0 Fri Sep =A03 17:23:26 2010 =A0 =A0 =A0= =A0(r212182) >> @@ -116,8 +116,10 @@ _assert_sbuf_state(const char *fun, stru >> >> =A0#endif /* _KERNEL && INVARIANTS */ >> >> +#ifdef _KERNEL >> =A0CTASSERT(powerof2(SBUF_MAXEXTENDSIZE)); >> =A0CTASSERT(powerof2(SBUF_MAXEXTENDINCR)); >> +#endif >> >> =A0static int >> =A0sbuf_extendsize(int size) > > Hi, > > as I can see, the next (and maybe preferred) model is used in system head= ers: > > #ifdef CTASSERT > CTASSERT(...); > #endif Needed, even in the kernel, since CTASSERT() is only defined if the kernel-only header has been included. If this macro were defined in a user header, then it would have to be more global (probably defined in ) but not in the application namespace (probably spelled __CTASSERT()), so it would be uglier. Bruce --0-78721968-1283780718=:954--