01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ASSERT (3X) ASSERT (3X)<br />

NAME<br />

assert - verify program assertion<br />

SYNOPSIS<br />

#include < a.ssert.h ><br />

assert (expression)<br />

int expression;<br />

DESCRIPTION<br />

This macro is useful for putting diagnostics into programs. When<br />

it is executed, if expression is false (zero), assert prints<br />

"Assertion failed: expression, file xyz, line nnn"<br />

on the standard error output and aborts. In the error message,<br />

xyz is the name of the source file and nnn the source line number<br />

of the assert statement.<br />

Compiling with the preprocessor option -DNDEBUG (see cpp (1)),<br />

or with the preprocessor control statement "#define NDEBUG"<br />

ahead of the "#include < assert.h>" statement, will stop assertions<br />

from being compiled into the program.<br />

SEE ALSO<br />

cpp( l), abort(3C).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!