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 strict-overflow warning when compiling with gcc >= 12 #2366

Merged

Conversation

angmolin
Copy link
Contributor

@angmolin angmolin commented Dec 9, 2023

Describe the PR
This PR solves a problem with strict-overflow when compiling the tinyusb examples with gcc >=12. Here is the output:

tinyusb/src/class/audio/audio_device.c:1568:23: error: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Werror=strict-overflow]
 1568 |         while (p_desc < p_desc_end)
      |                ~~~~~~~^~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors

This PR solves issue #2365

Additional context
Compiled from Rocky Linux 9

@HiFiPhile
Copy link
Collaborator

Thanks for the pr, could you add a comment?

@angmolin
Copy link
Contributor Author

Hello, I've just added a comment to the PR to explain why I changed the condition. Thank you for feedback.

@HiFiPhile HiFiPhile merged commit 71f1400 into hathach:master Dec 10, 2023
45 checks passed
@angmolin angmolin deleted the bugfix/gcc+12-strict-overflow-warning branch December 10, 2023 16:24
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.

2 participants