mdvorak / esp-double-reset

Detect double reset on ESP32, based on ESP-IDF.
The Unlicense
1 stars 2 forks source link

Compilation error in idf release-v5.0 #6

Closed NightSkySK closed 6 months ago

NightSkySK commented 1 year ago

Hi,

I found some issues compiling code with the esp-double-reset component using esp-idf release-v5.0. I haven't noticed any issue compiling same code with release-v4.3 or release-v4.4

/opt/esp/idf/components/log/include/esp_log.h:265:27: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  265 | #define LOG_COLOR(COLOR)  "\033[0;" COLOR "m"
      |                           ^~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:268:27: note: in expansion of macro 'LOG_COLOR'
  268 | #define LOG_COLOR_E       LOG_COLOR(LOG_COLOR_RED)
      |                           ^~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:282:37: note: in expansion of macro 'LOG_COLOR_E'
  282 | #define LOG_FORMAT(letter, format)  LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
      |                                     ^~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:410:86: note: in expansion of macro 'LOG_FORMAT'
  410 |         if (level==ESP_LOG_ERROR )          { esp_log_write(ESP_LOG_ERROR,      tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
      |                                                                                      ^~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:432:41: note: in expansion of macro 'ESP_LOG_LEVEL'
  432 |         if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
      |                                         ^~~~~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:342:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
  342 | #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO,    tag, format, ##__VA_ARGS__)
      |                                      ^~~~~~~~~~~~~~~~~~~
/app/NightSkySK/mSpaceGate-firmware/esp-double-reset/src/double_reset.c:189:9: note: in expansion of macro 'ESP_LOGI'
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      |         ^~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:265:27: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  265 | #define LOG_COLOR(COLOR)  "\033[0;" COLOR "m"
      |                           ^~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:269:27: note: in expansion of macro 'LOG_COLOR'
  269 | #define LOG_COLOR_W       LOG_COLOR(LOG_COLOR_BROWN)
      |                           ^~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:282:37: note: in expansion of macro 'LOG_COLOR_W'
  282 | #define LOG_FORMAT(letter, format)  LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
      |                                     ^~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:411:86: note: in expansion of macro 'LOG_FORMAT'
  411 |         else if (level==ESP_LOG_WARN )      { esp_log_write(ESP_LOG_WARN,       tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
      |                                                                                      ^~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:432:41: note: in expansion of macro 'ESP_LOG_LEVEL'
  432 |         if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
      |                                         ^~~~~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:342:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
  342 | #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO,    tag, format, ##__VA_ARGS__)
      |                                      ^~~~~~~~~~~~~~~~~~~
/app/NightSkySK/mSpaceGate-firmware/esp-double-reset/src/double_reset.c:189:9: note: in expansion of macro 'ESP_LOGI'
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      |         ^~~~~~~~
/app/NightSkySK/mSpaceGate-firmware/esp-double-reset/src/double_reset.c:189:1: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      | ^       ~~~
/opt/esp/idf/components/log/include/esp_log.h:282:59: note: in definition of macro 'LOG_FORMAT'
  282 | #define LOG_FORMAT(letter, format)  LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
      |                                                           ^~~~~~
/opt/esp/idf/components/log/include/esp_log.h:432:41: note: in expansion of macro 'ESP_LOG_LEVEL'
  432 |         if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
      |                                         ^~~~~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:342:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
  342 | #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO,    tag, format, ##__VA_ARGS__)
      |                                      ^~~~~~~~~~~~~~~~~~~
/app/NightSkySK/mSpaceGate-firmware/esp-double-reset/src/double_reset.c:189:9: note: in expansion of macro 'ESP_LOGI'
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      |         ^~~~~~~~
/app/NightSkySK/mSpaceGate-firmware/esp-double-reset/src/double_reset.c:189:1: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      | ^       ~~~
/opt/esp/idf/components/log/include/esp_log.h:282:59: note: in definition of macro 'LOG_FORMAT'
  282 | #define LOG_FORMAT(letter, format)  LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
      |                                                           ^~~~~~
/opt/esp/idf/components/log/include/esp_log.h:432:41: note: in expansion of macro 'ESP_LOG_LEVEL'
  432 |         if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
      |                                         ^~~~~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:342:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
  342 | #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO,    tag, format, ##__VA_ARGS__)
      |                                      ^~~~~~~~~~~~~~~~~~~
/app/NightSkySK/mSpaceGate-firmware/esp-double-reset/src/double_reset.c:189:9: note: in expansion of macro 'ESP_LOGI'
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      |         ^~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:265:27: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  265 | #define LOG_COLOR(COLOR)  "\033[0;" COLOR "m"
      |                           ^~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:270:27: note: in expansion of macro 'LOG_COLOR'
  270 | #define LOG_COLOR_I       LOG_COLOR(LOG_COLOR_GREEN)
      |                           ^~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:282:37: note: in expansion of macro 'LOG_COLOR_I'
  282 | #define LOG_FORMAT(letter, format)  LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
      |                                     ^~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:414:86: note: in expansion of macro 'LOG_FORMAT'
  414 |         else                                { esp_log_write(ESP_LOG_INFO,       tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
      |                                                                                      ^~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:432:41: note: in expansion of macro 'ESP_LOG_LEVEL'
  432 |         if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
      |                                         ^~~~~~~~~~~~~
/opt/esp/idf/components/log/include/esp_log.h:342:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
  342 | #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO,    tag, format, ##__VA_ARGS__)
      |                                      ^~~~~~~~~~~~~~~~~~~
/app/NightSkySK/mSpaceGate-firmware/esp-double-reset/src/double_reset.c:189:9: note: in expansion of macro 'ESP_LOGI'
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      |         ^~~~~~~~
cc1: some warnings being treated as errors
mdvorak commented 1 year ago

Hi, thank you for reporting this, I'll take a look, give me few days to get to it.

NightSkySK commented 1 year ago

@mdvorak it seems to be the same reason why one of the workflow builds failed in your GitHub CI platformio recently.

/home/runner/work/esp-double-reset/esp-double-reset/src/double_reset.c: In function 'double_reset_start':
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:[265](https://github.com/mdvorak/esp-double-reset/actions/runs/5196888479/jobs/9371064600#step:6:266):27: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  265 | #define LOG_COLOR(COLOR)  "\033[0;" COLOR "m"
      |                           ^~~~~~~~~
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:[268](https://github.com/mdvorak/esp-double-reset/actions/runs/5196888479/jobs/9371064600#step:6:269):27: note: in expansion of macro 'LOG_COLOR'
  268 | #define LOG_COLOR_E       LOG_COLOR(LOG_COLOR_RED)
      |                           ^~~~~~~~~
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:282:37: note: in expansion of macro 'LOG_COLOR_E'
  282 | #define LOG_FORMAT(letter, format)  LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
      |                                     ^~~~~~~~~~
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:410:86: note: in expansion of macro 'LOG_FORMAT'
  410 |         if (level==ESP_LOG_ERROR )          { esp_log_write(ESP_LOG_ERROR,      tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
      |                                                                                      ^~~~~~~~~~
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:432:41: note: in expansion of macro 'ESP_LOG_LEVEL'
  432 |         if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
      |                                         ^~~~~~~~~~~~~
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:342:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
  342 | #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO,    tag, format, ##__VA_ARGS__)
      |                                      ^~~~~~~~~~~~~~~~~~~
/home/runner/work/esp-double-reset/esp-double-reset/src/double_reset.c:189:9: note: in expansion of macro 'ESP_LOGI'
  189 |         ESP_LOGI(TAG, "double reset flag set, waiting for %d ms", timeout_ms);
      |         ^~~~~~~~
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:265:27: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  265 | #define LOG_COLOR(COLOR)  "\033[0;" COLOR "m"
      |                           ^~~~~~~~~
/home/runner/.platformio/packages/framework-espidf/components/log/include/esp_log.h:[269](https://github.com/mdvorak/esp-double-reset/actions/runs/5196888479/jobs/9371064600#step:6:270):27: note: in expansion of macro 'LOG_COLOR'
[...]

Have you got any chance to look into it? I found the thread which describe the same issue https://github.com/espressif/esp-idf/issues/10379 Suggested solution is described here: https://github.com/espressif/esp-idf/issues/10379#issuecomment-1353302879