From: Angus Gratton Date: Mon, 1 Oct 2018 06:22:33 +0000 (+1000) Subject: esp_err: Don't compile in error message strings in "silent assertions" mode X-Git-Tag: v3.2-beta1~80^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=127693126ae8c4eb898be60b0d452bf3ecb1bdf9;p=esp-idf esp_err: Don't compile in error message strings in "silent assertions" mode Reported on forum https://esp32.com/viewtopic.php?f=13&t=7396&p=31419#p31419 --- diff --git a/components/esp32/include/esp_err.h b/components/esp32/include/esp_err.h index 9dcb25af6e..8000825e79 100644 --- a/components/esp32/include/esp_err.h +++ b/components/esp32/include/esp_err.h @@ -102,6 +102,13 @@ void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const cha esp_err_t __err_rc = (x); \ (void) sizeof(__err_rc); \ } while(0); +#elif defined(CONFIG_OPTIMIZATION_ASSERTIONS_SILENT) +#define ESP_ERROR_CHECK(x) do { \ + esp_err_t __err_rc = (x); \ + if (__err_rc != ESP_OK) { \ + abort(); \ + } \ + } while(0); #else #define ESP_ERROR_CHECK(x) do { \ esp_err_t __err_rc = (x); \