From owner-svn-src-head@freebsd.org Sun Aug 2 00:22:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6ABF9B1B4F; Sun, 2 Aug 2015 00:22:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6C56867; Sun, 2 Aug 2015 00:22:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720MFCJ023072; Sun, 2 Aug 2015 00:22:15 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720MFqp023071; Sun, 2 Aug 2015 00:22:15 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508020022.t720MFqp023071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 00:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286170 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:22:16 -0000 Author: jmg Date: Sun Aug 2 00:22:14 2015 New Revision: 286170 URL: https://svnweb.freebsd.org/changeset/base/286170 Log: mark this function as deprecated, and put the warning first, since I doubt most people will read to the end... Note the use of sys/cdefs.h for pre-C11 compilers... I didn't included a note about being compatibile w/ userland since a C11 feature should be obviously usable in userland... Suggested by: imp Modified: head/share/man/man9/CTASSERT.9 Modified: head/share/man/man9/CTASSERT.9 ============================================================================== --- head/share/man/man9/CTASSERT.9 Sun Aug 2 00:18:48 2015 (r286169) +++ head/share/man/man9/CTASSERT.9 Sun Aug 2 00:22:14 2015 (r286170) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2015 +.Dd August 1, 2015 .Dt CTASSERT 9 .Os .Sh NAME @@ -39,6 +39,15 @@ .Sh DESCRIPTION The .Fn CTASSERT +macro is deprecated and the C11 standard +.Fn _Static_assert +should be used instead. +The header +.Fa sys/cdefs.h +should be included to provide compatibility for pre-C11 compilers. +.Pp +The +.Fn CTASSERT macro evaluates .Fa expression at compile time and causes a compiler error if it is false. @@ -48,10 +57,6 @@ The macro is useful for asserting the size or alignment of important data structures and variables during compilation, which would otherwise cause the code to fail at run time. -.Pp -The -.Fn CTASSERT -macro is not usable in userland. .Sh EXAMPLES Assert that the size of the .Vt uuid