File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2626.\" SUCH DAMAGE.
2727.\"
28- .Dd April 20, 2021
28+ .Dd May 17, 2026
2929.Dt ASSERT 3
3030.Os
3131.Sh NAME
@@ -76,13 +76,17 @@ is defined determines the behavior of assert from that point forward
7676until the end of the unit or another include of
7777.In assert.h .
7878.Pp
79+ In C23 and later, the
80+ .Fn assert
81+ uses ellipsis as the parameter.
82+ .Pp
7983The
8084.Fn assert
8185macro should only be used for ensuring the developer's expectations
8286hold true.
8387It is not appropriate for regular run-time error detection.
8488.Pp
85- The
89+ In pre-C23 compilation modes, the
8690.Fn static_assert
8791macro expands to
8892.Fn _Static_assert ,
@@ -96,6 +100,13 @@ The initial form of the
96100containing a string literal message was introduced in C11 standard, and
97101the other form with no string literal is to be implemented by C2x and
98102some compilers may lack its adoption at present.
103+ .Pp
104+ In C23 and later,
105+ .Fn static_assert
106+ is a language keyword, and
107+ .Fn _Static_assert
108+ is provided as an obsolescent alternative spelling that should not be
109+ used for new code and development..
99110.Sh EXAMPLES
100111The assertion:
101112.Dl " assert(1 == 0);"
@@ -123,12 +134,18 @@ If none is provided, it only points at the constraint.
123134The
124135.Fn assert
125136macro conforms to
126- .St -isoC-99 .
137+ .St -isoC-99
138+ and
139+ .St -isoC-2023 ,
140+ depending on the compilation mode.
127141.Pp
128142The
129143.Fn static_assert
130- macro conforms to
131- .St -isoC-2011 .
144+ conforms to
145+ .St -isoC-2011 ,
146+ wherein defined as a macro, and
147+ .St -isoC-2023 ,
148+ as a language keyword, depending on the compilation mode.
132149.Sh HISTORY
133150An
134151.Nm
You can’t perform that action at this time.
0 commit comments