summaryrefslogtreecommitdiff
path: root/static/v10/man3/assert.3
blob: 973b6d363a6a5503264bbb8beb793f601098dbf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.TH ASSERT 3X
.CT 2 debug_tune
.SH NAME
assert \(mi assertion checking
.SH SYNOPSIS
.B #include <assert.h>
.PP
.B void assert(expression);
.SH DESCRIPTION
.PP
.I Assert
is a macro that indicates
.I expression
is expected to be nonzero at this point in the program.
It causes an
.IR abort (3)
with a diagnostic comment on the standard output
when
.I expression
is zero.
Compiling with the
.IR cc (1)
option
.B -DNDEBUG
effectively makes the expression always nonzero.
.SH DIAGNOSTICS
`Assertion failed: file
.I f
line
.I n',
where
.I f
is the source file and
.I n
the source line number
of the
.I assert
statement.