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: initialize the uninitialized #975

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mariobodemann
Copy link

While building all demos I found that several colors are uninitialized, and where throwing an error when building.

Sample "error":

pimoroni-pico/examples/stellar_unicorn/stellar_lava_lamp.cpp: In function 'int main()':
pimoroni-pico/examples/stellar_unicorn/stellar_lava_lamp.cpp:128:27: error: 'bright_r' may be used uninitialized [-Werror=maybe-uninitialized]
  128 |           graphics.set_pen(bright_r, bright_g, bright_b);
      |           ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pimoroni-pico/examples/stellar_unicorn/stellar_lava_lamp.cpp:113:13: note: 'bright_r' was declared here
  113 |     uint8_t bright_r, bright_g, bright_b;
      |             ^~~~~~~~

I could have added the build flag for dismissing that warning, but I felt more explicit is better.

Let me know what you think.

while building all demos I found that several colors are uninitialized,
and where throwing an error when building.

I could have added the flag for dismissing that warning, but I felt
more explicit is better.
@Gadgetoid
Copy link
Member

Thank you, more explicit is indeed better. I try to build with Werror and Wall where possible, but we’re still targeting a pretty old compiler 😬

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