-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
audio.h: error: ISO C restricts enumerator values to range of 'int' before C23 [-Werror=pedantic] #2690
Comments
I read the post ,does it work with |
works fine. Also tested with
Do you need a PR or do the change yourself? |
Please make a PR so I can approve it sooner. |
fix error ~/dsp/libs/tinyusb/src/class/audio/audio.h:643:53: error: ISO C restricts enumerator values to range of 'int' before C23 [-Werror=pedantic] 643 | AUDIO_CHANNEL_CONFIG_RAW_DATA = 0x80000000, // TODO | ^~~~~~~~~~ compilation terminated due to -Wfatal-errors. Closes: hathach#2690
maybe we should re-open this until we find a solution |
"1u << 30u" will fix it |
That's 0x40000000 not 0x80000000 ! |
I thought we didn't need such large enum values. If that's how the uac standard defines it, then we can only use #define. |
Operating System
Linux
Board
STM32H563 Nucleo
Firmware
custom
What happened ?
These lines issue a warning/error when strictly following the ISO C standard before 23
tinyusb/src/class/audio/audio.h
Line 492 in 756ad35
tinyusb/src/class/audio/audio.h
Line 643 in 756ad35
How to reproduce ?
built with
gcc -Wfatal-errors -Wall -Wextra -Wpedantic -std=c11
For more insight see https://stackoverflow.com/questions/11314545/casting-enum-definition-to-unsigned-int
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
Screenshots
No response
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: