Commit | Line | Data |
---|---|---|
95f51977 | 1 | .\" @(#)assert.3 6.2 (Berkeley) 5/12/86 |
0361aa26 | 2 | .\" |
95f51977 | 3 | .TH ASSERT 3 "May 12, 1986" |
0361aa26 KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | assert \- program verification | |
7 | .SH SYNOPSIS | |
8 | .B #include <assert.h> | |
9 | .PP | |
10 | .B assert(expression) | |
11 | .SH DESCRIPTION | |
12 | .PP | |
13 | .I Assert | |
14 | is a macro that indicates | |
15 | .I expression | |
16 | is expected to be true at this point in the program. | |
17 | It causes an | |
18 | .IR exit (2) | |
43397477 | 19 | with a diagnostic comment on the standard output when |
0361aa26 KM |
20 | .I expression |
21 | is false (0). | |
22 | Compiling with the | |
23 | .IR cc (1) | |
24 | option | |
25 | .SM | |
26 | .B \-DNDEBUG | |
27 | effectively deletes | |
28 | .I assert | |
29 | from the program. | |
30 | .SH DIAGNOSTICS | |
31 | `Assertion failed: file | |
32 | .I f | |
33 | line | |
34 | .I n.' | |
35 | .I F | |
36 | is the source file and | |
37 | .I n | |
43397477 | 38 | the source line number of the |
0361aa26 KM |
39 | .I assert |
40 | statement. |