2004-04-10 18:53:55 +00:00
|
|
|
.TH ASSERT 3
|
|
|
|
|
.SH NAME
|
|
|
|
|
assert \- check program invariants
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
.B #include <u.h>
|
|
|
|
|
.br
|
|
|
|
|
.B #include <libc.h>
|
|
|
|
|
.PP
|
|
|
|
|
.B
|
|
|
|
|
#define assert if(cond);else _assert("cond")
|
|
|
|
|
.PP
|
|
|
|
|
.B
|
|
|
|
|
void _assert(int cond)
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
.I Assert
|
|
|
|
|
is a preprocessor macro that
|
|
|
|
|
(via
|
|
|
|
|
.IR _assert )
|
|
|
|
|
prints a message and calls
|
|
|
|
|
.I abort
|
|
|
|
|
when
|
|
|
|
|
.I cond
|
|
|
|
|
is false.
|
|
|
|
|
.SH SOURCE
|
2004-04-19 19:22:56 +00:00
|
|
|
.B /usr/local/plan9/src/libc/port/_assert.c
|