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