Skip to content

Fix -Werror=maybe-uninitialized warning in bmp5_get_fifo_data#9

Open
heblushabus wants to merge 1 commit intoboschsensortec:masterfrom
heblushabus:master
Open

Fix -Werror=maybe-uninitialized warning in bmp5_get_fifo_data#9
heblushabus wants to merge 1 commit intoboschsensortec:masterfrom
heblushabus:master

Conversation

@heblushabus
Copy link
Copy Markdown

When compiling with GCC on higher optimization levels (like -O2 or -Os) alongside -Werror, the compiler throws a maybe-uninitialized error for fifo_len in bmp5_get_fifo_data().

Initializing fifo_len to 0 resolves this compiler error and ensures safer behavior without affecting the logic, as it is populated by reference via bmp5_get_fifo_len() immediately after.

Fix -Werror=maybe-uninitialized warning in bmp5_get_fifo_data
Copilot AI review requested due to automatic review settings March 13, 2026 17:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Resolves a GCC -Werror=maybe-uninitialized build failure in the BMP5 driver by explicitly initializing a local FIFO length variable before it is populated via an out-parameter.

Changes:

  • Initialize fifo_len to 0 in bmp5_get_fifo_data() to eliminate maybe-uninitialized warnings at higher optimization levels.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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