Manpage of ASSERT

Google
Web www.fiveanddime.net

ASSERT

Section: NEWLIB (3)
Updated: 2005 Feb 23
Index Return to Main Contents
 

NAME

1.5 `assert'--Macro for Debugging Diagnostics

 

SYNOPSIS


     #include <assert.h>
     void assert(int EXPRESSION);  

DESCRIPTION

Use this macro to embed debuggging diagnostic statements in your programs. The argument EXPRESSION should be an expression which evaluates to true (nonzero) when your program is working as you intended.


   When EXPRESSION evaluates to false (zero), `assert' calls `abort', after first printing a message showing what failed and where:


      Assertion failed: EXPRESSION, file FILENAME, line LINENO


   The macro is defined to permit you to turn off all uses of `assert' at compile time by defining `NDEBUG' as a preprocessor variable. If you do this, the `assert' macro expands to


      (void(0))

 

RETURNS

`assert' does not return a value.

 

PORTABILITY

The `assert' macro is required by ANSI, as is the behavior when `NDEBUG' is defined.


   Supporting OS subroutines required (only if enabled): `close', `fstat', `getpid', `isatty', `kill', `lseek', `read', `sbrk', `write'.

 

SEE ALSO

assert is part of the libc library. The full documentation for libc is maintained as a Texinfo manual. If info and libc are properly installed at your site, the command
info libc

will give you access to the complete manual.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
PORTABILITY
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:25:12 GMT, May 16, 2005



www.fiveanddime.net








Google
Web www.fiveanddime.net