]> pd.if.org Git - pdclib/blob - man3/assert.3
dos2unix
[pdclib] / man3 / assert.3
1 .\" This file is part of the Public Domain C Library (PDCLib).
2 .\" Permission is granted to use, modify, and / or redistribute at will.
3 .\"
4 .Dd
5 .Dt assert 3
6 .Os
7 .\"
8 .Sh NAME
9 .Nm assert
10 .Nd validate assertion
11 .\"
12 .Sh SYNOPSIS
13 .In assert.h
14 .Fn "void assert" "<scalar expression>"
15 .\"
16 .Sh DESCRIPTION
17 If
18 .Dv NDEBUG
19 was defined when
20 .In assert.h
21 was last included, the macro
22 .Nm
23 results in no code being generated. Otherwise, if the expression evaluates to 
24 false, an error message is printed to 
25 .Va stderr
26 and execution is terminated by invoking
27 .Fn abort .
28 .Sh IMPLEMENTATION NOTES
29 The enclosing function of the call to
30 .Nm
31 will only be printed in the error message when compiling for C99, or a later
32 revision of the C standard. 
33 .\"
34 .Sh SEE ALSO
35 .Xr _Exit 3
36 .Xr quick_exit 3
37 .Xr exit 3
38 .Xr abort 3
39 .\"
40 .Sh STANDARDS
41 Conforming to
42 .St -isoC-90 ,
43 .St -isoC-99 .