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

Fix printf long int compiler error #1479

Merged
merged 1 commit into from May 31, 2022
Merged

Conversation

M3gaFr3ak
Copy link
Contributor

@M3gaFr3ak M3gaFr3ak commented May 28, 2022

Makes the printf variable a long int.
This fixes the following compile error

tinyusb/examples/device/uac2_headset/src/main.c: In function 'tud_audio_clock_get_request':
tinyusb/examples/device/uac2_headset/src/main.c:159:40: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  159 |       TU_LOG1("Clock get current freq %u\r\n", current_sample_rate);
      |                                       ~^       ~~~~~~~~~~~~~~~~~~~
      |                                        |       |
      |                                        |       uint32_t {aka long unsigned int}
      |                                        unsigned int
      |                                       %lu
compilation terminated due to -Wfatal-errors.
tinyusb/examples/device/uac2_headset/src/main.c: In function 'tud_audio_clock_set_request':
tinyusb/examples/device/uac2_headset/src/main.c:208:39: error: format '%d' expects argument of type 'int', but argument 2 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  208 |     TU_LOG1("Clock set current freq: %d\r\n", current_sample_rate);
      |                                      ~^       ~~~~~~~~~~~~~~~~~~~
      |                                       |       |
      |                                       int     uint32_t {aka long unsigned int}
      |                                      %ld
compilation terminated due to -Wfatal-errors.

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for your PR

@hathach hathach merged commit ab7c23a into hathach:master May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants