Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

assert - Macro for diagnostics

&pagelevel(4)&pagelevel

Definition

#include <assert.h>

void assert(int expression);

The assert macro determines whether a given expression is false (zero) at a particular point
in the program. If this is the case, the program is terminated with abort, and the following
comment is printed on the standard error output (stderr):

"CCM0009 Assertion failed: file xyz, line nnn"

xyz is the name of the source file; nnn is the line number of the line with the assert call.

Note

assert calls are ignored in the program (i.e. not executed) if you compile the program with
the following compiler option:

SOURCE-PROPERTIES = PARAMETERS(DEFINE = NDEBUG)

See also

abort