Everything

assert


Adds diagnostics into programs.

[Format]

#include <assert.h>

void assert (long expression);

[Parameters]

expression Expression to be evaluated.

[Remarks]

When expression is true, the assert macro terminates processing without returning a value. If expression is false, it outputs diagnostic information to the standard error file in the form defined by the compiler, and then calls the abort function.

The diagnostic information includes the parameter's program text, source file name, and source line numbers.

Implementation define:
The following message is output when expression is false in assert (expression):
The message depends on the lang option setting at compilation.

(1) When -lang=c99 is not specified (C (C89), C++, or EC++ language):

      ASSERTION FAILED:expressionFILE<file name>,LINE<line number>

(2) When -lang=c99 is specified (C (C99) language):

      ASSERTION FAILED:expressionFILE<file name>,LINE<line number>FUNCNAME<function name>