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