You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a pretty bespoke build setup for Godot and godot-cpp, so there is a chance I did something wrong when upgrading to 10.0.0-rc1, but I am getting this warning from my compiler:
1>.../godot/godot-cpp/src/gdextension_interface_loader.cpp(507): error C2220: the following warning is treated as an error
1>...\godot\godot-cpp\src\gdextension_interface_loader.cpp(290): warning C6011: Dereferencing NULL pointer 'print_error'. : Lines: 279, 282, 285, 288, 290
And this is because LOAD_PROC_ADDRESS(print_error, GDExtensionInterfacePrintError); expands to:
::godot::gdextension_interface::print_error = (GDExtensionInterfacePrintError)p_get_proc_address("print_error");
if (!::godot::gdextension_interface::print_error) {
::godot::gdextension_interface::print_error("Unable to load GDExtension interface function ""print_error""()", __FUNCTION__, "...\\godot\\godot-cpp\\src\\gdextension_interface_loader.cpp", 290, false);
returnfalse;
};
So the compiler can see that invoking ::godot::gdextension_interface::print_error in this code path is guaranteed to be a nullptr.
Steps to reproduce
I am doing scons gdextension_dir=(path to where I have Godot editor --dump-extension-api and also I copy core\extension\gdextension_interface.json here) build_library=no
Then I have a custom CMake target that globs up all the output files to create a godot-cpp static library.
Minimal reproduction project
Not feasible to share. Or at least hoping it can be avoided.
Activity
dsnopek commentedon Jan 27, 2026
Ah, yeah, we manually load
print_errorearly on. We should just not try to loadprint_erroragain laterdsnopek commentedon Jan 27, 2026
I just posted PR #1912 which should fix this, but I haven't tested it on MSVC. Please let me know if it works for you!
brycehutchings commentedon Jan 27, 2026
Confirmed, no more compiler warnings/errors! Thank you