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

Prevent -Wtype-limits warning on GCC 11 due to unsigned comparison #1323

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

dsnopek
Copy link
Collaborator

@dsnopek dsnopek commented Nov 30, 2023

Fixes #1322

I don't know if this is the best fix, it does what I wish GCC would do, which is just turn unsigned_value >= 0 into true :-)

FYI, I'm not personally getting this error locally, even though I am using GCC 11.4 on Ubuntu 22.04, which is the same as the issue reporter. So, someone that's actually getting this error should confirm that this fixes it.

@dsnopek dsnopek added the bug This has been identified as a bug label Nov 30, 2023
@dsnopek dsnopek added this to the 4.x milestone Nov 30, 2023
@dsnopek dsnopek requested a review from a team as a code owner November 30, 2023 21:24
src/godot.cpp Outdated Show resolved Hide resolved
@grabusr
Copy link

grabusr commented Dec 1, 2023

Hi David
I use CMake 3.26.4 and Ninja generator.
I have checked you fix. It works, thanks!

@akien-mga akien-mga changed the title Avoid error from -Werror=type-limits on GCC 11 Prevent -Wtype-limits warning on GCC 11 due to unsigned comparison Dec 1, 2023
@akien-mga akien-mga merged commit 17137b2 into godotengine:master Dec 1, 2023
12 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

akien-mga commented Dec 1, 2023

@grabusr Were you building the test project? Or were you building with GODOT_CPP_WARNING_AS_ERROR enabled?

Edit: Nevermind I see the library build with CMake has logic to force treating warnings as errors regardless of that option... #1324.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Dec 1, 2023
@dsnopek
Copy link
Collaborator Author

dsnopek commented Jan 22, 2024

Cherry-picking to 4.2 in #1372

@dsnopek
Copy link
Collaborator Author

dsnopek commented Jan 22, 2024

Cherry-picking to 4.1 in #1373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This has been identified as a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

type-limits check prevents compiling 4.2 version by GCC 11
3 participants