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

GDExtension: Fix -Wtype-limits warning in compatibility_maximum patch check #88527

Merged

Conversation

akien-mga
Copy link
Member

Fixes this GCC 13.2.1 warning:

In file included from core/extension/scu/scu_core_extension.gen.cpp:2:
./core/extension/gdextension.cpp: In static member function 'static Error GDExtensionResourceLoader::load_gdextension_resource(const String&, Ref<GDExtension>&)':
./core/extension/gdextension.cpp:933:52: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
  933 |                         compatible = VERSION_PATCH <= compatibility_maximum[2];

And cleanup some dead code in version.h, we now always define VERSION_PATCH.

@godotengine/gdextension After confirming this is correct, feel free to merge the PR yourselves, to fix the warning in the master branch for other users.

…atch check

And cleanup some dead code in `version.h`, we now always define `VERSION_PATCH`.
@akien-mga akien-mga merged commit 34edb5b into godotengine:master Feb 19, 2024
16 checks passed
@akien-mga akien-mga deleted the gdextension-fix-Wtype-limits-warning branch February 19, 2024 07:03
Comment on lines -50 to -56
#if VERSION_PATCH
// Example: "3.1.4"
#define VERSION_NUMBER VERSION_BRANCH "." _MKSTR(VERSION_PATCH)
#else // patch is 0, we don't include it in the "pretty" version number.
// Example: "3.1" instead of "3.1.0"
#define VERSION_NUMBER VERSION_BRANCH
#endif // VERSION_PATCH
Copy link
Member Author

Choose a reason for hiding this comment

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

This change was wrong, I misunderstood it. This is not an #ifdef but an #if, so that's indeed the logic which was responsible for keeping our version as 4.3.dev. I'll bring it back.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done with 0246230.

akien-mga added a commit that referenced this pull request Feb 19, 2024
I misunderstood what this does, we still use this code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants