Skip to content

Commit 17137b2

Browse files
authored
Merge pull request godotengine#1323 from dsnopek/gcc-type-limits-error
Prevent `-Wtype-limits` warning on GCC 11 due to unsigned comparison
2 parents 54136ee + cad5be5 commit 17137b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/godot.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,12 @@ GDExtensionBool GDExtensionBinding::init(GDExtensionInterfaceGetProcAddress p_ge
271271
} else if (internal::godot_version.minor != GODOT_VERSION_MINOR) {
272272
compatible = internal::godot_version.minor > GODOT_VERSION_MINOR;
273273
} else {
274+
#if GODOT_VERSION_PATCH > 0
274275
compatible = internal::godot_version.patch >= GODOT_VERSION_PATCH;
276+
#else
277+
// Prevent -Wtype-limits warning due to unsigned comparison.
278+
compatible = true;
279+
#endif
275280
}
276281
if (!compatible) {
277282
// We need to use snprintf() here because vformat() uses Variant, and we haven't loaded

0 commit comments

Comments
 (0)