Skip to content
Snippets Groups Projects
Commit e2409139 authored by Simon Glass's avatar Simon Glass
Browse files

tiny-printf: Support assert()


At present assert() is not supported with tiny-printf, so when DEBUG is
enabled a build error is generated for each assert().

Add an __assert_fail() function to correct this. It prints a message and
then hangs.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 162a7a42
No related branches found
No related tags found
No related merge requests found
......@@ -185,3 +185,12 @@ int snprintf(char *buf, size_t size, const char *fmt, ...)
return ret;
}
void __assert_fail(const char *assertion, const char *file, unsigned line,
const char *function)
{
/* This will not return */
printf("%s:%u: %s: Assertion `%s' failed.", file, line, function,
assertion);
hang();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment