.TH ASSERT() "" "" "DDI/DKI Kernel Routine"
.PC "Debug an expression"
.B "#include <sys/debug.h>"
\fBvoid ASSERT(\fIexpression\^\fB)\fR
\fBint \fIexpression\^\fB;\fR
.PP
.B ASSERT()
tests the Boolean
.I expression
for correctness.
You can use this routine
to verify expressions in programs that you have compiled with the
symbol
.B DEBUG
.BR #define 'd
(for example, with the option
.B \-d
to the \*CO compiler).
.PP
If
.I expression
evaluates to non-zero (that is, the expression is correct), the call to
.B ASSERT()
has no effect.
If, however,
.I expression
evaluates to zero,
.B ASSERT()
panics the system.
It prints a message on the console that identifies
.IR expression ,
its source file, and its line number.
.SH "See Also"
.B 
cmn_err(),
DDI/DKI kernel routines
.R
.SH Notes
.B ASSERT()
has base or interrupt level.
It does not sleep.
.PP
A program can hold
driver-defined basic locks, read/write locks, and sleep locks
across calls to
.BR ASSERT() .
