-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Fix comment in gdextension_interface.h
#83415
Fix comment in gdextension_interface.h
#83415
Conversation
On top of that, I wonder if it wouldn't be better to also add an intermediary GDExtensionInterfaceGetGodotVersion get_godot_version = (GDExtensionInterfaceGetGodotVersion)(void*)p_get_proc_address("get_godot_version"); This is useful for some functions to avoid
what do you think ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good to me
(Sorry, this was probably my mistake :-))
Hm, I guess so. However, I don't want to end up getting too deep into details, so it doesn't distract from what we're trying to show. |
1322f1e
to
cbcdf38
Compare
@dsnopek I've updated the PR to add the I think it's better to have the user wonder why the |
I don't know, you trade one obscurity for another. Now the user wonders why there is an intermediate This is also rather compiler-specific; furthermore C++ code would likely use |
cbcdf38
to
312fc1b
Compare
@Bromeon I've udpated the PR to replace the cast in the snippet by a small explanation as you suggested |
gdextension_interface.h
312fc1b
to
5aa9f1c
Compare
The comment incorrectly defines a pointer type (note the cast on the right side of the equal is correct !)
This is misleading for the unsuspecting end-user, which is tempted to "solve" this by doing a de-reference... hence leading to a segfault 😞