Looking at the definition of the ESP_ERROR_CHECK macro in components/esp32/include/esp_err.h, I notice that it includes a final semicolon. Traditionally this is not done, so as to not break statements like this:
Code: Select all
if (some_condition)
ESP_ERROR_CHECK (some_func());
else
ESP_ERROR_CHECK (some_other_func());
Code: Select all
if (some_condition)
do {
esp_err_t rc = (some_func());
...
} while(0);;
else
do {
esp_err_t rc = (some_other_func());
...
} while(0);;
Code: Select all
error: 'else' without a previous 'if'
Code: Select all
if (some_condition)
ESP_ERROR_CHECK (some_func())
else
ESP_ERROR_CHECK (some_other_func())
Fixing this will break programs that do not have a final semicolon in the invocation.
cheers