diff options
author | davidcunado-arm <david.cunado@arm.com> | 2017-04-21 09:37:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-21 09:37:36 +0100 |
commit | 2edf64827f2fc807c54b9cf79fba3d112885a890 (patch) | |
tree | a3f11c9ec580209e36e6d2508fd703ed17bc7297 /lib/stdlib | |
parent | 85aa186ba11f49efef8e859cf5cab737c3ade26b (diff) | |
parent | aa61368eb554e9910c503f78560153805a2d6859 (diff) |
Merge pull request #906 from antonio-nino-diaz-arm/an/asserts-release
Add `ENABLE_ASSERTIONS` build option
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/assert.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/stdlib/assert.c b/lib/stdlib/assert.c index 3486e50b..3c0bd166 100644 --- a/lib/stdlib/assert.c +++ b/lib/stdlib/assert.c @@ -32,15 +32,18 @@ #include <debug.h> #include <platform.h> -/* - * This is a basic implementation. This could be improved. - */ -void __assert (const char *function, const char *file, unsigned int line, +void __assert(const char *function, const char *file, unsigned int line, const char *assertion) { +#if LOG_LEVEL >= LOG_LEVEL_INFO + /* + * Only print the output if LOG_LEVEL is higher or equal to + * LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1. + */ tf_printf("ASSERT: %s <%d> : %s\n", function, line, assertion); console_flush(); +#endif plat_panic_handler(); } |