Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error if ESP_EVENT_LOOP_PROFILING=y (IDFGH-10157) #11428

Closed
3 tasks done
AxelLin opened this issue May 18, 2023 · 1 comment
Closed
3 tasks done

Compile error if ESP_EVENT_LOOP_PROFILING=y (IDFGH-10157) #11428

AxelLin opened this issue May 18, 2023 · 1 comment
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@AxelLin
Copy link
Contributor

AxelLin commented May 18, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.2-dev-544-g54576b7528

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32C3DevKit-M1

Power Supply used.

USB

What is the expected behavior?

compile should not fail.

What is the actual behavior?

Hit below compile error if ESP_EVENT_LOOP_PROFILING=y.

/home/axel/esp/esp-idf/components/esp_event/esp_event.c: In function 'esp_event_dump':
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:26:39: error: format '%u' expects argument of type 'unsigned int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
   26 | #define LOOP_DUMP_FORMAT              "LOOP @%p,%s rx:%u dr:%u\n"
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:31:72: note: in definition of macro 'PRINT_DUMP_INFO'
   31 |                                             int cb = snprintf(dst, sz, __VA_ARGS__); \
      |                                                                        ^~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:968:34: note: in expansion of macro 'LOOP_DUMP_FORMAT'
  968 |         PRINT_DUMP_INFO(dst, sz, LOOP_DUMP_FORMAT, loop_it, loop_it->task != NULL ? loop_it->name : "none" ,
      |                                  ^~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:26:56: note: format string is defined here
   26 | #define LOOP_DUMP_FORMAT              "LOOP @%p,%s rx:%u dr:%u\n"
      |                                                       ~^
      |                                                        |
      |                                                        unsigned int
      |                                                       %lu
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:26:39: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
   26 | #define LOOP_DUMP_FORMAT              "LOOP @%p,%s rx:%u dr:%u\n"
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:31:72: note: in definition of macro 'PRINT_DUMP_INFO'
   31 |                                             int cb = snprintf(dst, sz, __VA_ARGS__); \
      |                                                                        ^~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:968:34: note: in expansion of macro 'LOOP_DUMP_FORMAT'
  968 |         PRINT_DUMP_INFO(dst, sz, LOOP_DUMP_FORMAT, loop_it, loop_it->task != NULL ? loop_it->name : "none" ,
      |                                  ^~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:26:62: note: format string is defined here
   26 | #define LOOP_DUMP_FORMAT              "LOOP @%p,%s rx:%u dr:%u\n"
      |                                                             ~^
      |                                                              |
      |                                                              unsigned int
      |                                                             %lu
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:28:39: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
   28 | #define HANDLER_DUMP_FORMAT           "  HANDLER @%p ev:%s,%s inv:%u time:%lld us\n"
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:31:72: note: in definition of macro 'PRINT_DUMP_INFO'
   31 |                                             int cb = snprintf(dst, sz, __VA_ARGS__); \
      |                                                                        ^~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:975:42: note: in expansion of macro 'HANDLER_DUMP_FORMAT'
  975 |                 PRINT_DUMP_INFO(dst, sz, HANDLER_DUMP_FORMAT, handler_it->handler_ctx->handler, "ESP_EVENT_ANY_BASE",
      |                                          ^~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:28:68: note: format string is defined here
   28 | #define HANDLER_DUMP_FORMAT           "  HANDLER @%p ev:%s,%s inv:%u time:%lld us\n"
      |                                                                   ~^
      |                                                                    |
      |                                                                    unsigned int
      |                                                                   %lu
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:28:39: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
   28 | #define HANDLER_DUMP_FORMAT           "  HANDLER @%p ev:%s,%s inv:%u time:%lld us\n"
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:31:72: note: in definition of macro 'PRINT_DUMP_INFO'
   31 |                                             int cb = snprintf(dst, sz, __VA_ARGS__); \
      |                                                                        ^~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:981:46: note: in expansion of macro 'HANDLER_DUMP_FORMAT'
  981 |                     PRINT_DUMP_INFO(dst, sz, HANDLER_DUMP_FORMAT, handler_it->handler_ctx->handler, base_node_it->base ,
      |                                              ^~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:28:68: note: format string is defined here
   28 | #define HANDLER_DUMP_FORMAT           "  HANDLER @%p ev:%s,%s inv:%u time:%lld us\n"
      |                                                                   ~^
      |                                                                    |
      |                                                                    unsigned int
      |                                                                   %lu
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:988:68: error: format '%d' expects argument of type 'int', but argument 4 has type 'int32_t' {aka 'long int'} [-Werror=format=]
  988 |                         snprintf(id_str_buf, sizeof(id_str_buf), "%d", id_node_it->id);
      |                                                                   ~^   ~~~~~~~~~~~~~~
      |                                                                    |             |
      |                                                                    int           int32_t {aka long int}
      |                                                                   %ld
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:28:39: error: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
   28 | #define HANDLER_DUMP_FORMAT           "  HANDLER @%p ev:%s,%s inv:%u time:%lld us\n"
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:31:72: note: in definition of macro 'PRINT_DUMP_INFO'
   31 |                                             int cb = snprintf(dst, sz, __VA_ARGS__); \
      |                                                                        ^~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:990:50: note: in expansion of macro 'HANDLER_DUMP_FORMAT'
  990 |                         PRINT_DUMP_INFO(dst, sz, HANDLER_DUMP_FORMAT, handler_it->handler_ctx->handler, base_node_it->base ,
      |                                                  ^~~~~~~~~~~~~~~~~~~
/home/axel/esp/esp-idf/components/esp_event/esp_event.c:28:68: note: format string is defined here
   28 | #define HANDLER_DUMP_FORMAT           "  HANDLER @%p ev:%s,%s inv:%u time:%lld us\n"
      |                                                                   ~^
      |                                                                    |
      |                                                                    unsigned int
      |                                                                   %lu
cc1: some warnings being treated as errors

Steps to reproduce.

Just set ESP_EVENT_LOOP_PROFILING=y and compile.

Debug Logs.

No response

More Information.

No response

@AxelLin AxelLin added the Type: Bug bugs in IDF label May 18, 2023
@github-actions github-actions bot changed the title Compile error if ESP_EVENT_LOOP_PROFILING=y Compile error if ESP_EVENT_LOOP_PROFILING=y (IDFGH-10157) May 18, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label May 18, 2023
@ESP-Marius
Copy link
Collaborator

Thanks for letting us know. We are trying to fix all of these formatting issues, but some of them might still be hiding behind configs like this.

Guess this also identifies a config we are not properly testing and should add a test for 😅

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels May 23, 2023
espressif-bot pushed a commit that referenced this issue Jul 15, 2023
Closes #11428

See merge request !23833
espressif-bot pushed a commit that referenced this issue Jul 22, 2023
Closes #11428

See merge request !23833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants