INtime SDK Help
assert

Prints a diagnostic message and aborts the calling thread.

#include <assert.h>
#include <stdio.h>

void assert (int expression);

Parameters

expression
C expression specifying assertion being tested.

Remarks

Use the assert macro in program development to identify program logic errors. Choose expression so that it holds true only if the program is operating as intended.

After debugging a program, remove assert calls from the program using the special identifier NDEBUG. If NDEBUG is defined by any value with a /D command-line option or with a #define directive, the C preprocessor removes all assert calls from the program source.

Return Values

Any value but 0 (zero)
Success. No action is taken.
0 (zero)
Failure. The function calls abort.

The diagnostic message has this form:

Assertion failed: expression, file filename, line linenumber

Where:

filename The source file's name.
linenumber Line number of the assertion that failed in the source file.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/assert.h assert.h
stdio.h
clib.lib

See Also

abort, raise, signal