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

video_device: fix uninitialized variable warning #2484

Merged
merged 1 commit into from
Feb 21, 2024
Merged

video_device: fix uninitialized variable warning #2484

merged 1 commit into from
Feb 21, 2024

Conversation

eightycc
Copy link

Describe the PR
Fixes may be used uninitialized compiler warning for variable interval_ms when building at optimization level -Og. Compiler is GCC 13.2.

Additional context

../../lib/tinyusb/src/class/video/video_device.c: In function '_negotiate_streaming_parameters':
../../lib/tinyusb/src/class/video/video_device.c:578:36: error: 'interval_ms' may be used uninitialized [-Werror=maybe-uninitialized]
  578 |         payload_size = (frame_size + interval_ms - 1) / interval_ms + 2;
      |                         ~~~~~~~~~~~^~~~~~~~~~~~~
../../lib/tinyusb/src/class/video/video_device.c:530:29: note: 'interval_ms' was declared here
  530 |     uint_fast32_t interval, interval_ms;
      |                             ^~~~~~~~~~~

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.

look good, thank you

@hathach hathach merged commit 0f3d285 into hathach:master Feb 21, 2024
49 checks passed
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