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

Build fail on Ubuntu Noble in g2d.c: last_quadrant is used unitialized; treat-all-warnings-as-errors #326

Closed
ojura opened this issue May 6, 2024 · 4 comments · Fixed by #327

Comments

@ojura
Copy link

ojura commented May 6, 2024

Build fails because of unitialized variable use:

  /<<BUILDDIR>>package/common/g2d.c: In function ‘g2d_polygon_contains_point’:
  /<<BUILDDIR>>package/common/g2d.c:351:17: error: ‘last_quadrant’ may be used uninitialized [-Werror=maybe-uninitialized]
    351 |             int dquadrant = quadrant - last_quadrant;
        |                 ^~~~~~~~~
  /<<BUILDDIR>>package/common/g2d.c:324:9: note: ‘last_quadrant’ was declared here
    324 |     int last_quadrant;
        |         ^~~~~~~~~~~~~
@christian-rauch
Copy link
Collaborator

This should be fixed by #324. I could not reproduce the issue with the 24.04 Docker image. Can you check if the PR solves your issue?

@christian-rauch
Copy link
Collaborator

Can you provide instructions on how to reproduce this? Which CMake generator and compiler are you using? Is this in a Docker container or a "bare metal" installation?

@ojura
Copy link
Author

ojura commented May 9, 2024

Hi @christian-rauch, sorry for missing your response. I am glad that you figured it out and thanks for the fix. For me, it was clear from the source code that the last_quadrant variable was uninitialized, and I didn't consider it necessary to include more detailed reproduction info.

@christian-rauch
Copy link
Collaborator

I could see that it was not initialised too. But I was still curious how to reproduce the error locally as I have seen this issue on other CI pipelines too but I could reproduce this in a Docker container. Anyway, this should now be fixed.

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 a pull request may close this issue.

2 participants