Merge pull request #2715 from pan-/NDEBUG_optimization

Allow the trace output by mbed error to be conditional of NDEBUG.
pull/2808/head
Sam Grove 2016-09-24 16:32:34 -05:00 committed by GitHub
commit bd3d6abbc4
1 changed files with 2 additions and 0 deletions

View File

@ -24,9 +24,11 @@
#endif #endif
WEAK void error(const char* format, ...) { WEAK void error(const char* format, ...) {
#ifndef NDEBUG
va_list arg; va_list arg;
va_start(arg, format); va_start(arg, format);
mbed_error_vfprintf(format, arg); mbed_error_vfprintf(format, arg);
va_end(arg); va_end(arg);
#endif
exit(1); exit(1);
} }