summaryrefslogtreecommitdiffstats
path: root/share/man/man9/CTASSERT.9
diff options
context:
space:
mode:
Diffstat (limited to 'share/man/man9/CTASSERT.9')
-rw-r--r--share/man/man9/CTASSERT.919
1 files changed, 10 insertions, 9 deletions
diff --git a/share/man/man9/CTASSERT.9 b/share/man/man9/CTASSERT.9
index 6211c2e..39f25d6 100644
--- a/share/man/man9/CTASSERT.9
+++ b/share/man/man9/CTASSERT.9
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 5, 2008
+.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,14 +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.
-.Sh IMPLEMENTATION NOTES
-The
-.Fn CTASSERT
-macro should not be used in a header file.
-It is implemented using a dummy typedef, with a name (based on line number)
-that may conflict with a
-.Fn CTASSERT
-in a source file including that header.
.Sh EXAMPLES
Assert that the size of the
.Vt uuid
OpenPOWER on IntegriCloud