assert.h File Reference
The header <assert.h> defines the assert macro.
More...
#include <nlibc.h>
#include <os1/defs_os1.h>
#include <os1/stdio_os1.h>
#include <stdio.h>
Include dependency graph for assert.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
|
Defines |
#define | assert(e) ((void)((e)||_assert("assert: Assertion '" #e "' failed in " __FILE__ ":" , __LINE__))) |
Functions |
int | _assert (char *err_str, unsigned line) |
Detailed Description
The header <assert.h> defines the assert macro.
- NAME
- assert - for debugging purposes to return diagnostic information
- SYNOPSIS
- #include <assert.h>
assert (scaler expression)
- DESCRIPTION
- The assert() is used for debugging purposes. It returns diagnostic information to the
standard error file
- RETURN VALUE
- If NDEBUD is defined the diagnostic debugging information is given, otherwise
assert() is ignored. Common error outputting is in the form: "Assertion failed:
expression, filename, line-number"
- NOTE
- The assert header is used for debugging purposes. NDEBUG is its external References
If NDEBUG is defined, the expression, source code filename, and line
number are sent to the standard error, and then calls the abort function.
In additional with the assert-Macro one inserts a kind of tests:
void assert(int expression)
If this expression have the value Null when assert(expression) preceeded,
then returns the assert-Macro to stderr probably
the following message:
Assertion failed: expression, file filename, line nnn
Then the proceeding will be stopped by calling abort.
The file name of the programm and also the line number are comming from the
Processor-Macros __FILE__ and __LINE__
- IMPLEMENTATION
- The _assert function is implemented using write_string() and write_int(). In the final
version it should be changed to using the stdio routines and writing to stderr.
The exit(1) should be changed to abort().
- IMPLEMENTATION for APEnext: Completed and tested, write_int/string exchanged later (assert)
- VERSION
- Id
- assert.h,v 2.11 2005/10/27 20:04:44 morinl Exp
ISO/IEC 9899:1999 (E) Standard
- Author:
- Olaf Kaczmarek (okacz@physik.uni-bielefeld.de)
Definition in file assert.h.
Define Documentation
#define assert |
( |
e |
|
) |
((void)((e)||_assert("assert: Assertion '" #e "' failed in " __FILE__ ":" , __LINE__)))
|
|
Function Documentation
int _assert |
( |
char * |
err_str, |
|
|
unsigned |
line |
|
) |
|
|
Generated on Tue Jan 10 12:43:41 2006 for nlibc by
1.3.5