assert


Adds diagnostic features to the program.

[Classification]

Standard library

[Syntax]

#include <asssert.h>

void assert(int expression);

[Description]

Adds diagnostic features to the program.

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

The diagnostic information includes the program text of the parameters, the name of the source file, and the line number of the source.

When -lang=c99 is specified, the function name is also included in the diagnostic information. [V1.06 or later]

 

If you wish to disable the assert macro, include a #define NDEBUG statement before assert.h is loaded.