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

esp_pm_impl_dump_stats fprintf wrong format (IDFGH-8930) #10347

Closed
3 tasks done
dizcza opened this issue Dec 10, 2022 · 1 comment
Closed
3 tasks done

esp_pm_impl_dump_stats fprintf wrong format (IDFGH-8930) #10347

dizcza opened this issue Dec 10, 2022 · 1 comment
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@dizcza
Copy link
Contributor

dizcza commented Dec 10, 2022

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.

master branch

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

What is the expected behavior?

It builds successfully.

What is the actual behavior?

/home/dizcza/tools/esp-idf/components/esp_pm/pm_impl.c: In function 'esp_pm_impl_dump_stats':
/home/dizcza/tools/esp-idf/components/esp_pm/pm_impl.c:707:32: error: format '%d' expects argument of type 'int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  707 |         fprintf(out, "%-8s  %-3dM%-7s %-10lld  %-2d%%\n",
      |                             ~~~^
      |                                |
      |                                int
      |                             %-3ld
  708 |                 s_mode_names[i],
  709 |                 s_cpu_freq_by_mode[i].freq_mhz,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      uint32_t {aka long unsigned int}
cc1: some warnings being treated as errors
[692/803] Building CXX object esp-idf/wear_levelling/CMakeFiles/__idf_wear_levelling.dir/WL_Flash.cpp.objninja: build stopped: subcommand failed.
HINT: The issue is better to resolve by replacing format specifiers to 'PRI'-family macros (include <inttypes.h> header file).

Steps to reproduce.

Enable PM profiling in menuconfig.

Build or installation Logs.

No response

More Information.

No response

@dizcza dizcza added the Type: Bug bugs in IDF label Dec 10, 2022
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 10, 2022
@github-actions github-actions bot changed the title esp_pm_impl_dump_stats fprintf wrong format esp_pm_impl_dump_stats fprintf wrong format (IDFGH-8930) Dec 10, 2022
@ESP-Marius
Copy link
Collaborator

You are right!

We already have an internal MR that fixes this issue and i'll link this issue to it.

If you wanna fix it yourself quickly before commit is synced to Github you could change the line to:

fprintf(out, "%-8s %-3"PRIu32"M%-7s %-10lld %-2d%%\n",

@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed and removed Status: Opened Issue is new labels Dec 12, 2022
@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Reviewing Issue is being reviewed Resolution: NA Issue resolution is unavailable labels Dec 22, 2022
espressif-bot pushed a commit that referenced this issue Mar 4, 2023
This commit fixes a string formatting error in esp_pm with CONFIG_PM_PROFILING
is enabled.

Closes #10347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants