__assert_fail

Name

__assert_fail -- abort the program after false assertion

Synopsis

void
__assert_fail(const char *assertion,
              const char *file,
              unsigned int line,
              const char *function);

Description

This function, when passed a string containing an asserted expression, a filename, and a line number, prints a message on the standard error stream such as:

a.c:10: foobar: Assertion a == b failed.

It then aborts program execution via a call to abort. The exact form of the message is up to the implementation.

If FUNCTION is NULL, then omit information about the function.

FILE, LINE, and ASSERTION must be non-NULL.

__assert_fail is not in the source standard; it is only in the binary standard.