Skip to content

Commit

Permalink
Merge pull request #1323 from dsnopek/gcc-type-limits-error
Browse files Browse the repository at this point in the history
Prevent `-Wtype-limits` warning on GCC 11 due to unsigned comparison
  • Loading branch information
akien-mga authored Dec 1, 2023
2 parents 54136ee + cad5be5 commit 17137b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/godot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,12 @@ GDExtensionBool GDExtensionBinding::init(GDExtensionInterfaceGetProcAddress p_ge
} else if (internal::godot_version.minor != GODOT_VERSION_MINOR) {
compatible = internal::godot_version.minor > GODOT_VERSION_MINOR;
} else {
#if GODOT_VERSION_PATCH > 0
compatible = internal::godot_version.patch >= GODOT_VERSION_PATCH;
#else
// Prevent -Wtype-limits warning due to unsigned comparison.
compatible = true;
#endif
}
if (!compatible) {
// We need to use snprintf() here because vformat() uses Variant, and we haven't loaded
Expand Down

0 comments on commit 17137b2

Please sign in to comment.