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

audio.h: fix error ISO C restricts enumerator values to range of 'int' #2693

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

ra1nb0w
Copy link
Contributor

@ra1nb0w ra1nb0w commented Jun 28, 2024

Describe the PR

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: #2690

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
@HiFiPhile HiFiPhile merged commit 236aa96 into hathach:master Jun 28, 2024
16 checks passed
@ra1nb0w ra1nb0w deleted the enum-int branch June 28, 2024 19:33
@ra1nb0w
Copy link
Contributor Author

ra1nb0w commented Jun 28, 2024

thank you. Have a nice weekend!

@hathach
Copy link
Owner

hathach commented Jul 5, 2024

will need to revert this since this cause, note that int is not guaranteed to be 32bit for all platform. Not sure why build workflow does not trigger for this PR.

warning error: left shift count >= width of type [-Werror=shift-count-overflow]

@HiFiPhile
Copy link
Collaborator

Good spot, don't know how I overlooked this even I work alot on STM8 who has 16 bit int...
Maybe use #define to replace enum later.

@ra1nb0w
Copy link
Contributor Author

ra1nb0w commented Jul 5, 2024

using int32_t ?

@hathach
Copy link
Owner

hathach commented Jul 5, 2024

using int32_t ?

it is still overflowed since first bit is considered signed bit.

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.

audio.h: error: ISO C restricts enumerator values to range of 'int' before C23 [-Werror=pedantic]
3 participants