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
This commit is contained in:
parent
61ab25cd3d
commit
94d919b999
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286170
@ -26,7 +26,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd July 30, 2015
|
.Dd August 1, 2015
|
||||||
.Dt CTASSERT 9
|
.Dt CTASSERT 9
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -39,6 +39,15 @@
|
|||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Fn CTASSERT
|
.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
|
macro evaluates
|
||||||
.Fa expression
|
.Fa expression
|
||||||
at compile time and causes a compiler error if it is false.
|
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
|
macro is useful for asserting the size or alignment of important
|
||||||
data structures and variables during compilation, which would
|
data structures and variables during compilation, which would
|
||||||
otherwise cause the code to fail at run time.
|
otherwise cause the code to fail at run time.
|
||||||
.Pp
|
|
||||||
The
|
|
||||||
.Fn CTASSERT
|
|
||||||
macro is not usable in userland.
|
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
Assert that the size of the
|
Assert that the size of the
|
||||||
.Vt uuid
|
.Vt uuid
|
||||||
|
Loading…
Reference in New Issue
Block a user