-
Notifications
You must be signed in to change notification settings - Fork 181
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
v3.3/glfw: Warnings when building using -tags wayland #359
Comments
I got the same error after upgrading WSL Ubuntu from 20.04.5 to 22.04.1. Before the upgrade I was getting an error that looks like https://gitlab.gnome.org/GNOME/gtk/-/issues/5025 ... so it's gone now, but this new one appeared. |
I tried to fix this but failed. The corresponding imports seem to all be imported already. I wonder, is this a a bug upstream? |
Hello, At this time, what I did on Fedora 40 (because it's not errors and not warnings), was to follow the recommendations given by the compiler. I give you the patch to see where I changed lines: diff -aur v3.3/glfw/glfw/src/wl_window.c /home/metal3d/Projects/Scoreboard/vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/src/wl_window.c
--- v3.3/glfw/glfw/src/wl_window.c 2024-04-23 22:55:46.566521640 +0200
+++ /home/metal3d/Projects/Scoreboard/vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/src/wl_window.c 2024-04-23 22:52:19.169067823 +0200
@@ -51,7 +51,8 @@
{
int fd;
- fd = mkostemp(tmpname, O_CLOEXEC);
+ //fd = mkostemp(tmpname, O_CLOEXEC);
+ fd = mkstemp(tmpname);
if (fd >= 0)
unlink(tmpname);
@@ -199,7 +200,8 @@
const time_t seconds = (time_t) *timeout;
const long nanoseconds = (long) ((*timeout - seconds) * 1e9);
const struct timespec ts = { seconds, nanoseconds };
- const int result = ppoll(fds, count, &ts, NULL);
+ //const int result = ppoll(fds, count, &ts, NULL);
+ const int result = poll(fds, count, (int) (*timeout * 1e3));
#elif defined(__NetBSD__)
const time_t seconds = (time_t) *timeout;
const long nanoseconds = (long) ((*timeout - seconds) * 1e9);
@@ -1228,7 +1230,8 @@
{
int fds[2];
- if (pipe2(fds, O_CLOEXEC) == -1)
+ //if (pipe2(fds, O_CLOEXEC) == -1)
+ if (pipe(fds) == -1)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Failed to create pipe for data offer: %s", |
Per discussions we had on Slack, that patch changes the behaviour in a braking way. It is not equivalent. There is something else that is wrong |
Yes, actually we see that these functions are enclosed in some macro / templates. It seems that non of the Maybe we missed an compiler option to set All in "feature.h" file. |
see go-gl#359 features.h needs `_GNU_SOURCE` to be set to allow stdlib.h to declare the functions.
OK, so I created a pull-request to fix the problem. The only thing missing was a simple variable to set at compile time. The “features.h” file simply expects “_GNU_SOURCE” to internally activate “__USE_GNU”. As a result, the necessary functions can be created. Don't ask me how I found it, I was just wandering through the header files and accidentally stumbled across it. Anyway, thanks @Jacalz for pointing me in a more interesting direction than changing functions to less compatible ones. |
This is now the warning message we get because Fedora 40 now treats implicit declarations as an error due to their stricter security:
I updated the issue description to mention this. |
New warnings:
This is now the warning message we get after #399 has been merged to fix Fedora 40 now treating implicit declarations as an error due to their stricter security:
This should be fixed so we get no warnings. Removing
_GNU_SOURCE
being defined will make the build fail on Fedora 40.Old warnings:
I am getting these errors when building for Wayland. Opening the issue here in case there are issues on our end like last time.
The text was updated successfully, but these errors were encountered: