-
Notifications
You must be signed in to change notification settings - Fork 176
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
Warning and Note issued on Linux #213
Comments
This has since been fixed with glfw/glfw@5bcf9c7. |
Thank you for confirming that @elmindreda. We are already using the latest GLFW 3.2.1 version here. When the next version of GLFW containing the fix is released, we’ll update, and the warnings will disappear. They can be ignored until then. So, there’s nothing to do in go-gl/glfw at this time. |
Reopening for visibility (see #222 (comment)). /cc @capnm Nothing to do here other than to eventually update to the next version of GLFW. |
In go are the warnings very visible ;-) diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..3e94336
--- /dev/null
+++ b/go.mod
@@ -0,0 +1 @@
+module github.com/go-gl/glfw
diff --git a/v3.2/glfw/glfw/src/linux_joystick.c b/v3.2/glfw/glfw/src/linux_joystick.c
index 561b1eb..53ffb1a 100644
--- a/v3.2/glfw/glfw/src/linux_joystick.c
+++ b/v3.2/glfw/glfw/src/linux_joystick.c
@@ -215,15 +215,24 @@ GLFWbool _glfwInitJoysticksLinux(void)
while ((entry = readdir(dir)))
{
- char path[20];
regmatch_t match;
+ char* path = NULL;
if (regexec(&_glfw.linux_js.regex, entry->d_name, 1, &match, 0) != 0)
continue;
+#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
+ if (asprintf(&path, "%s/%s", dirname, entry->d_name) < 0)
+ {
+ _glfwInputError(GLFW_PLATFORM_ERROR,
+ "Linux: Failed to construct device path: %s",
+ strerror(errno));
+ continue;
+ }
- snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
if (openJoystickDevice(path))
count++;
+
+ free(path);
}
closedir(dir); go.mod:
|
please see 3.3 branch, this should be fixed there |
Unfortunately, the version from the v2 directory is pulled into my project by 3rd party packages and is still the same in the 3.3 branch :-( glfw-wip = 845371b
|
Ah build.go was missing -D_GNU_SOURCE. |
share a way to fix this warning.
after that, I got no warning anymore |
I can't tell if this has been fixed or not... but 18.04 Ubuntu as of 18OCT2019:
|
Hi Everyone, Sorry about the annoying warning, which came from the underlying glfw sources. Please upgrade to v3.3 (merged today in #256), and if you encounter any errors there, let's get them fixed! |
stopping it for now as I can't figure out how to disable the C compiler strict error checking. once a newer version go go-gl is released with latest glfw (see go-gl/glfw#213) we can give it another go. Signed-off-by: Matt Mulhern <mattmulhern01@gmail.com>
Fyi,
go-gl built fine except a warning and note appeared, so I thought I would post it here:
go get -u github.com/go-gl/glfw/v3.2/glfw
snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
^~~~~~~
my go environment
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xxx/Documents/Development/Go"
GORACE=""
GOROOT="/usr/local/bin/go"
GOTOOLDIR="/usr/local/bin/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build583228998=/tmp/go-build -gno-record-gcc-switches"
CXX="/usr/bin/clang++3.9"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
The text was updated successfully, but these errors were encountered: