summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2013-06-08 19:06:52 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2013-06-08 19:06:52 +0000
commit41a55873d47f9036578b951acc755a77be819dc0 (patch)
treed508695c298843d5952224a433ba2c924446f3f1 /share
parent6f5d7d986a8441a86a60a6ff989d87fb8b2bc337 (diff)
Add CTASSERT macro, for compile time assertions
ok kettenis@
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/kern.916
1 files changed, 14 insertions, 2 deletions
diff --git a/share/man/man9/kern.9 b/share/man/man9/kern.9
index c1c4faa7171..b12f83435d0 100644
--- a/share/man/man9/kern.9
+++ b/share/man/man9/kern.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: kern.9,v 1.16 2013/06/04 19:27:08 schwarze Exp $
+.\" $OpenBSD: kern.9,v 1.17 2013/06/08 19:06:51 sf Exp $
.\"
.\" Copyright (c) 2002, 2003 CubeSoft Communications, Inc.
.\" <http://www.csoft.org>
@@ -24,7 +24,7 @@
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 4 2013 $
+.Dd $Mdocdate: June 8 2013 $
.Dt KERN 9
.Os
.Sh NAME
@@ -108,6 +108,18 @@ enabled.
tests are only included if the kernel has
.Dv DEBUG
enabled.
+.Pp
+.nr nS 1
+.Fn CTASSERT "CONDITION"
+.nr nS 0
+.Pp
+This macro causes a compile time error if the given condition evaluates to
+false.
+Its main purpose is to verify assertions about type and struct sizes that
+would otherwise make the code fail at run time.
+.Fn CTASSERT
+can be used in global scope or at the start of blocks, where variable
+declarations are allowed.
.Sh BYTE STRINGS
.nr nS 1
.Ft int